Add flake8 check for blind excepts - #1959
Conversation
Add flake8 check for blind excepts using flake8-blind-except (B901).
|
The first commit in #1957 does nothing but fix these (except for the ones in |
|
This is awesome; thank you! ✨ Yes, let's cherry-pick the fixes from @wordofglass and then we can thi carefully about the Bluelet handlers. |
|
@jackwilsdon: Have you already done this locally? If not, I'd rebase this on master later and push the other changes. |
|
Have I cherry-picked your changes locally? I haven't had chance yet but I'll do it in a moment 👍. |
|
So it looks like we still have some files not passing the check: Taking a look at these files, I'm not entirely sure what exceptions could be thrown. Maybe @wordofglass or @sampsyo has a better insight into the code? Do we need to catch a On a semi-related note, is there a reason |
|
The one in The same goes probably for In the end, I think in tests this really does not matter as much. When they start failing, you might need to put in some more debugging code anyway. (I do not know these plugins, the above are first thoughts after having looked at the code for a few minutes.) |
|
Should I just whack some |
|
IMHO, naming |
|
Yep, all of these changes in the tests look right to me. |
|
I just noticed that this never got merged. @jackwilsdon, are you still in on it? Otherwise I'd rebase and push it. |
|
Good point, @wordofglass—this looks ready now, modulo a rebase. |
|
Rebased and committed to master (and fixed a (probably only recently introduced) |
|
I'll close this up then, thanks! |
Add flake8 check for blind excepts using flake8-blind-except, as suggested by @sampsyo in #1957.
Example of invalid code (copied from flake8-blind-except documentation):
Example of valid code (copied from flake8-blind-except documentation):
In it's current state (as of 698203e), this check is not passed by beets.
Here are the offending files and line numbers:
Should I fix these in this PR too?