Skip to content
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

Merged
merged 5 commits into from
Nov 27, 2021

Conversation

nickdrozd
Copy link
Contributor

Type
🔨 Refactoring

@Pierre-Sassoulas Pierre-Sassoulas added the Maintenance Discussion or action around maintaining astroid or the dev workflow label Nov 26, 2021
@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.9.1 milestone Nov 26, 2021
Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas left a 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)

@nickdrozd
Copy link
Contributor Author

Looks like the new version of Pylint triggers a few issues.

@@ -28,6 +28,8 @@
class BlockRangeMixIn:
Copy link
Member

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.

@Pierre-Sassoulas Pierre-Sassoulas changed the title Enable for_any_all check Upgrade to pylint 2.12 and enable for_any_all checker Nov 27, 2021
Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@Pierre-Sassoulas Pierre-Sassoulas merged commit 813aab5 into pylint-dev:main Nov 27, 2021
@@ -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
Copy link
Collaborator

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?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

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
Copy link
Member

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.

Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas Nov 28, 2021

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.

@cdce8p cdce8p mentioned this pull request Nov 28, 2021
tushar-deepsource pushed a commit to tushar-deepsource/astroid that referenced this pull request Dec 20, 2021
…#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>
@nickdrozd nickdrozd deleted the for-any-all branch October 7, 2024 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Maintenance Discussion or action around maintaining astroid or the dev workflow
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants