-
-
Notifications
You must be signed in to change notification settings - Fork 335
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
Ruff preview mode #3024
base: main
Are you sure you want to change the base?
Ruff preview mode #3024
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 think I'd vote weakly against using ruff preview.
If you just want to run CI checks it's enough to push to a branch in this repo, without opening a PR. (or even better run tests locally ofc)
02bf8b1
to
4061f6a
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3024 +/- ##
==========================================
- Coverage 99.58% 99.58% -0.01%
==========================================
Files 121 121
Lines 18166 18164 -2
Branches 3275 3273 -2
==========================================
- Hits 18091 18089 -2
Misses 52 52
Partials 23 23
|
|
I feel like this is a bug, so astral-sh/ruff#13037 is tracking this.
I was looking at whether ruff catches a forgotten prefix for fstrings like |
Maybe we should enable For these preview rules, we probably should disable |
There are no |
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.
Can we disable RUF029
? We're very deliberate with what is marked async
for trio
and what isn't so nothing should be missed. Tests are a different story but I don't think it matters for them. The false-positives are annoying! (and very noisy. probably like half of the line changes are adding noqa for this!)
Additionally, I don't think A005 brings any benefit. We know we're shadowing stdlib and that's intentional (well, except the underscore prefixed ones, which nobody cares about shadowing anyways).
Co-authored-by: A5rocks <[email protected]>
Co-authored-by: A5rocks <[email protected]>
b3c9dab
to
fe334dc
Compare
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 a few comments because some of the changes involved adding trailing commas. IIRC that's a separate PR? I left a comment on every file with the change rather than on every change.
# A005 is ignoring modules that shadow stdlib modules. | ||
'src/trio/_abc.py' = ['A005'] | ||
'src/trio/_socket.py' = ['A005'] | ||
'src/trio/_ssl.py' = ['A005'] |
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.
Given we're disabling it for all modules it would trigger on, would it make sense to globally ignore 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 had the intention of disabling it on current triggers so that in the event a new module was added it would be triggered for the new one. To be honest I don't see that realistically happening any time soon, but that was my logic.
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.
Ah that would make sense. TBH using the built in setting of names to ignore might work with less noise for that case. I'm not sure what would be better.
Co-authored-by: A5rocks <[email protected]>
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.
Everything in my last review seems to be addressed.
I'm not quite sure I like having an explanation with every instance of RUF029
but tbh just seeing that error code doesn't explain much -- I think having different formats of explanations visible at once is getting to me, while it wouldn't while programming (because I would only see a small portion of code).
This pull request enables ruff's preview mode.
Currently a work in progress, but I wanted to see if I've messed anything up in the unit tests.