-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Ruff 0.13 #20194
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
Draft
ntBre
wants to merge
16
commits into
main
Choose a base branch
from
brent/0.13.0
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Ruff 0.13 #20194
+105
−1,005
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
code | total | + violation | - violation | + fix | - fix |
---|---|---|---|---|---|
RUF059 | 980 | 980 | 0 | 0 | 0 |
RUF043 | 573 | 573 | 0 | 0 | 0 |
SIM117 | 432 | 0 | 0 | 432 | 0 |
I001 | 36 | 22 | 14 | 0 | 0 |
PYI061 | 21 | 21 | 0 | 0 | 0 |
PTH211 | 12 | 12 | 0 | 0 | 0 |
PYI059 | 10 | 10 | 0 | 0 | 0 |
ANN201 | 4 | 2 | 2 | 0 | 0 |
RUF100 | 4 | 0 | 4 | 0 | 0 |
D212 | 2 | 1 | 1 | 0 | 0 |
UP038 | 1 | 0 | 1 | 0 | 0 |
Linter (preview)
✅ ecosystem check detected no linter changes.
Formatter (stable)
✅ ecosystem check detected no format changes.
Formatter (preview)
✅ ecosystem check detected no format changes.
The tests looked good. For the docs, I added a `## See also` section pointing to the closely-related F841 (unused-variable) and the corresponding section to F841 pointing back to RUF059. It seems like you'd probably want both of these active or at least to know about the other when reading the docs.
Summary -- Rule and test/snapshot updated, the docs look good My one hesitation here is that we could hold off stabilizing the rule until its fix is also ready for stabilization, but this is also the only preview PTH rule, so I think it's okay to stabilize the rule and later (probably in the next minor release) stabilize the fixes together.
## Summary closes #7710 ## Test Plan It is is removal so i don't think we have to add tests otherwise i have followed test plan mentioned in contributing.md --------- Co-authored-by: Brent Westbrook <36778786+ntBre@users.noreply.github.com>
## Summary This PR Removes deprecated UP038 as per instructed in #18727 closes #18727 ## Test Plan I have run tests non of them failing One Question i have is do we have to document that UP038 is removed? --------- Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> Co-authored-by: Brent Westbrook <36778786+ntBre@users.noreply.github.com>
This one has been a bit contentious in the past. It usually uncovers ~700 ecosystem hits. See: - #16657 - #16690 But I think there's consensus that it's okay to merge as-is. We'd love an autofix since it's so common, but we can't reliably tell what a user meant. The pattern is ambiguous after all 😆 This is the first rule that actually needed its test case relocated, but the docs looked good.
This stabilizes the behavior introduced in #16565 which (roughly) tries to match an import like `import a.b.c` to an actual directory path `a/b/c` in order to label it as first-party, rather than simply looking for a directory `a`. Mainly this affects the sorting of imports in the presence of namespace packages, but a few other rules are affected as well.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Release branch for Ruff 0.13.0
Breaking changes
Behavior changes
flake8-simplify
] Stabilize fix safety ofmultiple-with-statements
(SIM117
) #20270pylint
] Stabilize adding U+061C tobidirectional-unicode
(PLE2502
) #20276pylint
] Stabilize ignoring__init__.py
foruseless-import-alias
(PLC0414
) #20271Recoded rules
Deprecated rules
Changed rules
Removed rules
pandas-vet
] Removepandas-df-variable-name
(PD901
) #19223pyupgrade
] Removenon-pep604-isinstance
(UP038
) #19156Stabilized rules
long-sleep-not-forever
(ASYNC116
) #20244unused-unpacked-variable
(RUF059
) #20233os-symlink
(PTH211
) #20229useless-class-metaclass-type
(UP050
) #20230generic-not-last-base-class
(PYI059
) #20246redundant-none-literal
(PYI061
) #20236f-string-number-format
(FURB116
) #20247pytest-raises-ambiguous-pattern
(RUF043
) #20253New or improved fixes
Deferred stabilizations
TODOs
emptyfirst commit (random whitespace change to get a baseline ecosystem check executable)Tests
Ruff invocations on examples to verify that behavior has been stabilized correctly.
ruff check example.py --no-cache \