-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Misc lints #4694
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
base: main
Are you sure you want to change the base?
Misc lints #4694
Conversation
…o using \N{} is a lot more editor friendly, good change
…e to parse that it is the empty set and is very had to type, while set() is more explicit and easy to type
…having unescaped \n s, so I fixed those, as well as converted some others for consistency
@MeGaGiGaGon for longevity i think it's better if you could:
|
The main reason I didn't do that is since especially with lints, I feel like it should be a lot more thought out and discussed than my approach. Since what lints you use defines the style of the code, I feel like any major changes to it, like switching to a whole new linting framework, should be a whole team effort. I'm also very new to linting in general, and the main reason I use ruff is that it is the thing I found first, followed by it having a lot of lints so it's very effective with my "enable all then trim" strategy. I'm unsure what else is out there in the ecosystem, which goes back to the "this should probably be a bigger discussion". And even assuming that ruff would be chosen as the linter, I was very conservative with my choices here. There are some lints I saw that I do like, but would cause a large amount of churn to enable for smaller benefits, which is why I only went with ones that are both fairly contained and seem like clear improvements. For context, there were 90 different lints raised, with 1253 total errors. Out of those I chose 10 lints to fix, making up 16 of the errors. This also leads into/has ties with a different discussion I feel is worth having, which is on linting blib2to3. Currently it is still excluded from coverage, and also has a lot more lints that could be actually worth fixing. At least for my changes, a lot of them have been inside blib2to3, so I've been wondering if it would be worthwhile to add it to the lints and clean up the code. That also has ties to a discussion I'm not sure ever got finished, #2318 (Switch to a new parser), and might be worth re-discussing since I'm not sure how the parser landscape has changed since 2021. Also I'm tired, so sorry for the long wall of text. I'll probably come back and edit this to make it more readable tomorrow morning. |
Description
I was bored so I decided to run all the ruff lints against
src/black
, and only fix the ones I liked, so here's the results. I tried my best to only pick ones that I thought made a clear improvement to the code without causing too much churn. All the reasoning is in the commit messages, but I also copied it here because github cuts it off.Checklist - did you ...
CHANGES.md
if necessary?