-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[refurb] Stabilize fix safety for readlines-in-for (FURB129)
#18496
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
[refurb] Stabilize fix safety for readlines-in-for (FURB129)
#18496
Conversation
| // https://github.com/astral-sh/ruff/pull/18208 | ||
| pub(crate) const fn is_multiple_with_statements_fix_safe_enabled( | ||
| settings: &LinterSettings, | ||
| ) -> bool { |
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.
Unrelated to the main change: just noticed this was missing a PR link and the prefix is_. This also accounts for the change in flake8_simplify/rules/ast_with.rs
5f1af44 to
11966be
Compare
78e13e3 to
2e4e0f7
Compare
|
| code | total | + violation | - violation | + fix | - fix |
|---|---|---|---|---|---|
| FURB129 | 10 | 0 | 0 | 10 | 0 |
Linter (preview)
✅ ecosystem check detected no linter changes.
|
Ecosystem check looks good to me! |
ntBre
left a comment
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.
LGTM, thanks!
Will you add these to the PR summary as you merge them? I'm also a bit paranoid about last time. What do you think about building up a Python code block and ruff invocation in the PR summary that makes sure that everything we stabilized makes it into the release? I'm picturing something like this for this case:
with open("file.txt") as fp:
for line in fp.readlines(): # FURB129
...ruff check example.py --no-cache \
--select FURB129 # room for more \ --select ... later|
Sounds good! We may need multiple code blocks in the end because for some stabilized behvaiors the file name matters (e.g. one of the behaviors cares whether the file is |
…18496) Note that the preview behavior was not documented (shame on us!) so the documentation was not modified. --------- Co-authored-by: Brent Westbrook <brentrwestbrook@gmail.com>
…18496) Note that the preview behavior was not documented (shame on us!) so the documentation was not modified. --------- Co-authored-by: Brent Westbrook <brentrwestbrook@gmail.com>
…18496) Note that the preview behavior was not documented (shame on us!) so the documentation was not modified. --------- Co-authored-by: Brent Westbrook <brentrwestbrook@gmail.com>
…18496) Note that the preview behavior was not documented (shame on us!) so the documentation was not modified. --------- Co-authored-by: Brent Westbrook <brentrwestbrook@gmail.com>
…18496) Note that the preview behavior was not documented (shame on us!) so the documentation was not modified. --------- Co-authored-by: Brent Westbrook <brentrwestbrook@gmail.com>
…18496) Note that the preview behavior was not documented (shame on us!) so the documentation was not modified. --------- Co-authored-by: Brent Westbrook <brentrwestbrook@gmail.com>
…18496) Note that the preview behavior was not documented (shame on us!) so the documentation was not modified. --------- Co-authored-by: Brent Westbrook <brentrwestbrook@gmail.com>
Note that the preview behavior was not documented (shame on us!) so the documentation was not modified.