-
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
Use ruff --preview
, drop flake8
#20318
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.
I like!
554a8a5
to
644ed4e
Compare
Looks good in general, but a sea of |
I think I was too tired when I did this 😅 |
644ed4e
to
6d7f834
Compare
Now that we gate our ruff updates via the tasks container, we can afford to be a bit more future-oriented here. This brings in a nice raft of fix-ups, including my personal favourite: RUF003 Comment contains ambiguous `µ` (MICRO SIGN). Did you mean `μ` (GREEK SMALL LETTER MU)? Sure... why not? The majority of fixes here are from a single rule suggesting to rewrite a and b or c as (a and b) or c But in most (but not all) cases in our code we actually want to write that as b if a else c I've also added some type annotations to help me make the right choice in places where it wasn't immediately clear.
`ruff` in preview mode now implements the various E[123] rules that we were depending on flake8 for. Drop it.
6d7f834
to
760ac17
Compare
Running with Is it known when the rules become "stable"? Is it a month, a week? I couldn't figure that out when I was looking into it. |
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'm good with this, I figure my taste of "fix future complains ealier" differs from Jelle's. Definitively don't want to override you there, just retracting my -1.
My take: probably like 95% of rules that end up in If we end up seeing something we don't like we always have the option to mask out that new rule and argue against it upstream, before it lands in stable...
Unfortunately, ruff seems a bit opaque on this point. There's https://docs.astral.sh/ruff/preview/ but it doesn't say much about the lifecycle/trajectory of a preview rule... |
Merged, I'll handle the files flake8 removal. |
No description provided.