-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add flake8 bugbear to pre-commit #7697
Add flake8 bugbear to pre-commit #7697
Conversation
As the former can be removed by interpreter optimisation.
ddb6cf6
to
d2a77e7
Compare
Pull Request Test Coverage Report for Build 3372880403
π - Coveralls |
d2a77e7
to
57a5c7d
Compare
This comment has been minimized.
This comment has been minimized.
@@ -529,7 +529,7 @@ def visit_default(self, node: nodes.NodeNG) -> None: | |||
tolineno = node.tolineno | |||
assert tolineno, node | |||
lines: list[str] = [] | |||
for line in range(line, tolineno + 1): | |||
for line in range(line, tolineno + 1): # noqa: B020 |
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.
What's the warning here?
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.
'Loop control variable overrides iterable it iterates' (It's by design)
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.
Are you sure? Can't for line
be for index
?
The iterable value just seems to be a integer that's called line
.
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.
I'd rather not touch this, my goal is to add flake8 bugbear not "fix" all legacy issues (especially when the fix is not trivial and the code is working well).
I don't have the time to fix everything, could we merge with the current disable so flake8 bugbear is applied on new code and the already working code stay as is ? In particular fixing dummy-variables-rgx seems 4 hours of work or more. Polishing working code we don't understand well means we can introduce bugs that we'll have to fix later. |
57a5c7d
to
266c0f5
Compare
π€ Effect of this PR on checked open source code: π€ Effect on pytest:
This comment was generated for commit 266c0f5 |
Type of Changes
Description
I realized that flake8-bugbear was configured in astroid but not pylint when upgrading pre-commit. Generally it's the other way around. There were some fixes to do, some of them valuable.