-
-
Notifications
You must be signed in to change notification settings - Fork 278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade to pylint 2.12 and enable for_any_all
checker
#1277
Conversation
nickdrozd
commented
Nov 26, 2021
Type | |
---|---|
✓ | 🔨 Refactoring |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great, thank you ! Could you also fix the other issues newly detected by pylint 2.12 ? (Or disable them if you don't have the time right now)
Looks like the new version of Pylint triggers a few issues. |
for more information, see https://pre-commit.ci
astroid/mixins.py
Outdated
@@ -28,6 +28,8 @@ | |||
class BlockRangeMixIn: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This mixin is not recognized as one, I'll fix this myself suggestions won't work here.
for_any_all
checker
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -448,7 +445,7 @@ def _fixed_source_line(self) -> Optional[int]: | |||
We need this method since not all nodes have :attr:`lineno` set. | |||
""" | |||
line = self.lineno | |||
_node: Optional[NodeNG] = self | |||
_node: Optional[NodeNG] = self # pylint: disable = used-before-assignment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a new false positive?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah! Thanks!
@@ -301,6 +301,9 @@ ignored-modules=typed_ast.ast3 | |||
# (useful for classes with attributes dynamically set). | |||
ignored-classes=SQLObject | |||
|
|||
# Regex pattern to define which classes are considered mixins. | |||
mixin-class-rgx=.*Mix[i|I]n |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Pierre-Sassoulas This will also match Mix|n
. It should just be .*Mix[Ii]n
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😄 Obviously I'm just handing the case with really big "i" using pipe, and did not make a regex mistake at all.
…#1277) * Enable for_any_all check * Upgrade to pylint 2.12 in pre-commit configuration * Fix new Pylint warnings * Upgrade the regex for Mixin Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>