-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Add flake8-bugbear to the test suite, resolve resulting lint errors #9320
Conversation
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.
Left some comments where I need some input.
(Post-PR) Per #9279 I also mentioned
These aren't taken into account with how the linter is currently set up, for that i need to manually |
(also before anyone comments on it, no, i cant make this PR smaller (than 200 lines), because i have to both add flake8-bugbear and fix all the small problems that pop up while going over the new linting suite errors) |
@ShadowJonathan When doing large repetitive changes like this it can help to do one of the following:
Also note that a PR above a couple of hundred lines of diff generally takes much longer to review. Small PRs are better! |
I could do this if there was a (The problem is is that i cant "enable just some of the checks", I could make PRs that in parallel that have every other category explicitly Finally I could also then just bring those "small fix PRs" in serial, but that'd take a while to be fixed, i'd have to keep track of every separated change locally (which may slowly become out of date), and a bunch of other stuff that's just plain overhead. If the TL;DR: Next time I'll make sure the small changes are better able to be applied into seperate PRs. 👍 |
@@ -24,7 +24,7 @@ | |||
try: | |||
python_dependencies.check_requirements() | |||
except python_dependencies.DependencyException as e: | |||
sys.stderr.writelines(e.message) | |||
sys.stderr.writelines(e.message) # noqa: B306 |
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.
Should we update this to be str(e)
?
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.
DependencyException.message
is actually a property that formats it properly, thus the noqa, this is in a few other places too
- add Optional to affected parameters - no `except BaseException`, but `except Exception`
Overall I like the direction this is heading; would you mind restructuring it so it's easier to review? I think that many of the changes in here are good (I'm especially happy to see the change to stop using mutable input arguments), but this PR tries to do too many unrelated things and it hinders discussion of individual changes. I'm going to close this so that we can start afresh. In particular I'm afraid of introducing regressions and it being difficult to bisect exactly what caused it. I would suggest splitting this work up into smaller pieces. A few ways this could be done: Strategy 1
Depending on the size of each of the changes, some of them could be grouped together if each change is in separate commit with a clear commit message. Strategy 2
This will cause conflicts, but they will be easy to fix since it is just the single line of which checks are enabled. As with above, some of the changes could be grouped if they're done in separate commits. |
I'm going to take a variant of strategy 2; i'll create a PR (like mentioned before) that'll explicitly enable checks in Does that sound good? TL;DR: PR that makes |
I think that sounds reasonable! Thanks for being understanding! |
(note to self; make tracker issue for it) |
The scope of this PR is the following;
flake8-bugbear
to thelint
extrasflake8
errorsraise X from e
Failure(e)
PR contains some comments on areas where wider intention isn't (as) clear.
Pull Request Checklist
EventStore
toEventWorkerStore
.".code blocks
.Closes #9279
Signed-off-by: Jonathan de Jong <jonathan@automatia.nl>