-
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
Add autofix for PYI010 #4634
Add autofix for PYI010 #4634
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.
If the type parameter is referenced elsewhere in the file, this change would break those references, right?
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.
Hmmm, you are correct. Fixing that might be non-trivial. Will think on it. Setting this PR to draft for now and will probably separate the two autofixes, and implement Y048 in between.
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.
We actually do now have the ability to track all read-references of a given symbol, so we could support this, but it would require some further changes (e.g., we'd need to run this rule after visiting the entire file). I might use it as an excuse to figure out how to make it work.
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.
Separated, making this PR only for PYI010. Not enough brainspace this evening to come up with a solution, but no need to block the other autofix. If the overhead of more but smaller PRs is fine for you and fellow maintainers, I'll cut my contributions into single chunks to avoid too much PR scope change in the future.
Generally, our practice would be to implement Y048 as-is, and then just keep the logic independent (so we might run into cases where one rule is enabled and another isn't, and we miss out on an opportunity to fix -- but that's fine.) |
PR Check ResultsEcosystem✅ ecosystem check detected no changes. BenchmarkLinux
Windows
|
Sounds good, I'll implement YO48. But do we want to make this rule flag on a multi-line function too? Even if you do not autofix, right now a stub function: def foo():
print("bla")
print("bla2") Will not flag a rule called def foo():
print("bla") The original plugin goes: if len(body) > 1:
self.error(body[1], Y048)
elif body:
statement = body[0]
# normally, should just be "..."
if isinstance(statement, ast.Pass):
self.error(statement, Y009)
# Ellipsis is fine. Str (docstrings) is not but we produce
# tailored error message for it elsewhere.
elif not (
isinstance(statement, ast.Expr)
and isinstance(statement.value, (ast.Ellipsis, ast.Str))
):
self.error(statement, Y010) So it assumes before checking for Y010 that the Y048 does not happen. Ruff allows for a more modular approach so it might make sense to not make any assumptions about how many lines the func is when checking for PYI010. |
@charliermarsh I think I'll just leave the autofix for PYI010 like so. If and when #4645 makes it in, the warning for the multi-line scenario is covered there (and an autofix can be added for that scenario as well). In case a user willingly disables that rule but enables this one, I guess it's ok for Ruff to assume the user knows they could miss a Violation. For future rules and autofixes in this plugin I'll keep the logic independent for |
@qdegraaf - Yeah sounds good -- this looks correct to me given the above. |
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [ruff](https://github.com/charliermarsh/ruff) ([changelog](https://github.com/charliermarsh/ruff/releases)) | `^0.0.270` -> `^0.0.271` | [![age](https://badges.renovateapi.com/packages/pypi/ruff/0.0.271/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/ruff/0.0.271/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/ruff/0.0.271/compatibility-slim/0.0.270)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/ruff/0.0.271/confidence-slim/0.0.270)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>charliermarsh/ruff</summary> ### [`v0.0.271`](https://github.com/charliermarsh/ruff/releases/tag/v0.0.271) [Compare Source](https://github.com/charliermarsh/ruff/compare/v0.0.270...v0.0.271) <!-- Release notes generated using configuration in .github/release.yml at main --> #### What's Changed ##### Rules - Add autofix for flake8-type-checking by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4742](https://github.com/charliermarsh/ruff/pull/4742) - \[`airflow`] Add AIR001: task variable name should be same as task_id arg by [@​jlaneve](https://github.com/jlaneve) in [https://github.com/charliermarsh/ruff/pull/4687](https://github.com/charliermarsh/ruff/pull/4687) - \[`flake8-bandit`] Implement S609, linux_commands_wildcard_injection by [@​scop](https://github.com/scop) in [https://github.com/charliermarsh/ruff/pull/4504](https://github.com/charliermarsh/ruff/pull/4504) - \[`flake8-bugbear`] Move duplicate-value rule to flake8-bugbear by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4882](https://github.com/charliermarsh/ruff/pull/4882) - \[`flake8-fixme`] Implement `flake8_fixme` and refactor `TodoDirective` by [@​evanrittenhouse](https://github.com/evanrittenhouse) in [https://github.com/charliermarsh/ruff/pull/4681](https://github.com/charliermarsh/ruff/pull/4681) - \[`flake8-future-annotations`] Implement `FA102` by [@​akx](https://github.com/akx) in [https://github.com/charliermarsh/ruff/pull/4702](https://github.com/charliermarsh/ruff/pull/4702) - \[`flake8-pyi`] Add PYI024 for `flake8-pyi` plugin by [@​qdegraaf](https://github.com/qdegraaf) in [https://github.com/charliermarsh/ruff/pull/4756](https://github.com/charliermarsh/ruff/pull/4756) - \[`flake8-pyi`] Add PYI034 for `flake8-pyi` plugin by [@​qdegraaf](https://github.com/qdegraaf) in [https://github.com/charliermarsh/ruff/pull/4764](https://github.com/charliermarsh/ruff/pull/4764) - \[`flake8-pyi`] Add `PYI032` rule with autofix by [@​qdegraaf](https://github.com/qdegraaf) in [https://github.com/charliermarsh/ruff/pull/4695](https://github.com/charliermarsh/ruff/pull/4695) - \[`flake8-pyi`] Add autofix for PYI010 by [@​qdegraaf](https://github.com/qdegraaf) in [https://github.com/charliermarsh/ruff/pull/4634](https://github.com/charliermarsh/ruff/pull/4634) - \[`flake8-pyi`] Implement PYI029 by [@​density](https://github.com/density) in [https://github.com/charliermarsh/ruff/pull/4851](https://github.com/charliermarsh/ruff/pull/4851) - \[`flake8-pyi`] Implement PYI035 by [@​density](https://github.com/density) in [https://github.com/charliermarsh/ruff/pull/4820](https://github.com/charliermarsh/ruff/pull/4820) - \[`flake8-pyi`] Implement PYI048 for `flake8-pyi` plugin by [@​qdegraaf](https://github.com/qdegraaf) in [https://github.com/charliermarsh/ruff/pull/4645](https://github.com/charliermarsh/ruff/pull/4645) - \[`flake8-pyi`] Implement PYI053 by [@​density](https://github.com/density) in [https://github.com/charliermarsh/ruff/pull/4770](https://github.com/charliermarsh/ruff/pull/4770) - \[`flake8-pyi`] Implement PYI054 by [@​density](https://github.com/density) in [https://github.com/charliermarsh/ruff/pull/4775](https://github.com/charliermarsh/ruff/pull/4775) - \[`flake8-pyi`] Implement `PYI025` by [@​qdegraaf](https://github.com/qdegraaf) in [https://github.com/charliermarsh/ruff/pull/4791](https://github.com/charliermarsh/ruff/pull/4791) - \[`flake8-pyi`] Implement `PYI045` by [@​density](https://github.com/density) in [https://github.com/charliermarsh/ruff/pull/4700](https://github.com/charliermarsh/ruff/pull/4700) - \[`pylint`] Add Pylint rule `C0208` (`use-sequence-for-iteration`) as `PLC0208` (`iteration-over-set`) by [@​tjkuson](https://github.com/tjkuson) in [https://github.com/charliermarsh/ruff/pull/4706](https://github.com/charliermarsh/ruff/pull/4706) - \[`pylint`] Add autofix for `PLR1701` (repeated-isinstance-calls) by [@​dhruvmanila](https://github.com/dhruvmanila) in [https://github.com/charliermarsh/ruff/pull/4792](https://github.com/charliermarsh/ruff/pull/4792) - \[`pylint`] Implement Pylint's `yield-inside-async-function` rule (`PLE1700`) by [@​chanman3388](https://github.com/chanman3388) in [https://github.com/charliermarsh/ruff/pull/4668](https://github.com/charliermarsh/ruff/pull/4668) - \[`pylint`] implement E307 for pylint invalid str return type by [@​Ryang20718](https://github.com/Ryang20718) in [https://github.com/charliermarsh/ruff/pull/4854](https://github.com/charliermarsh/ruff/pull/4854) - \[`ruff`] Lint pyproject.toml by [@​konstin](https://github.com/konstin) in [https://github.com/charliermarsh/ruff/pull/4496](https://github.com/charliermarsh/ruff/pull/4496) - \[`tryceratops`] Ignore error calls with `exc_info` in TRY400 by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4797](https://github.com/charliermarsh/ruff/pull/4797) ##### Settings - Add `pyflakes.extend-generics` setting by [@​JonathanPlasse](https://github.com/JonathanPlasse) in [https://github.com/charliermarsh/ruff/pull/4677](https://github.com/charliermarsh/ruff/pull/4677) ##### Bug Fixes - Fix PLW3301 false positive single argument nested min/max by [@​JonathanPlasse](https://github.com/JonathanPlasse) in [https://github.com/charliermarsh/ruff/pull/4683](https://github.com/charliermarsh/ruff/pull/4683) - Handle dotted alias imports to check for implicit imports by [@​dhruvmanila](https://github.com/dhruvmanila) in [https://github.com/charliermarsh/ruff/pull/4685](https://github.com/charliermarsh/ruff/pull/4685) - Flag empty strings in flake8-errmsg rules by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4745](https://github.com/charliermarsh/ruff/pull/4745) - Exclude function definition from too-many-statements rule by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4794](https://github.com/charliermarsh/ruff/pull/4794) - Preserve quotes in F523 fixer by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4836](https://github.com/charliermarsh/ruff/pull/4836) - Fix round-tripping of nested functions by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4875](https://github.com/charliermarsh/ruff/pull/4875) - Avoid early-exit in explicit-f-string-type-conversion by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4886](https://github.com/charliermarsh/ruff/pull/4886) - Avoid no-op fix for nested with expressions by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4906](https://github.com/charliermarsh/ruff/pull/4906) - Fix UP036 auto-fix error by [@​JonathanPlasse](https://github.com/JonathanPlasse) in [https://github.com/charliermarsh/ruff/pull/4679](https://github.com/charliermarsh/ruff/pull/4679) - Use class name as range for `B024` by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4647](https://github.com/charliermarsh/ruff/pull/4647) - Change TODO directive detection to work with multiple pound signs on the same line by [@​evanrittenhouse](https://github.com/evanrittenhouse) in [https://github.com/charliermarsh/ruff/pull/4558](https://github.com/charliermarsh/ruff/pull/4558) - Allow more immutable funcs for RUF009 by [@​qdegraaf](https://github.com/qdegraaf) in [https://github.com/charliermarsh/ruff/pull/4660](https://github.com/charliermarsh/ruff/pull/4660) - Avoid using typing-imported symbols for runtime edits by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4649](https://github.com/charliermarsh/ruff/pull/4649) - Fix `async for` formatting by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4675](https://github.com/charliermarsh/ruff/pull/4675) - Ignore **setattr** in FBT003 by [@​alexfikl](https://github.com/alexfikl) in [https://github.com/charliermarsh/ruff/pull/4752](https://github.com/charliermarsh/ruff/pull/4752) - Include ImportError in non-fixable try-catch imports by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4793](https://github.com/charliermarsh/ruff/pull/4793) - Avoid extra newline between diagnostics in grouped mode by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4776](https://github.com/charliermarsh/ruff/pull/4776) - Avoid enforcing native-literals rule within nested f-strings by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4488](https://github.com/charliermarsh/ruff/pull/4488) - Respect mixed variable assignment in RET504 by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4835](https://github.com/charliermarsh/ruff/pull/4835) - Make FLY002 autofix into a constant string instead of an f-string if all `join()` arguments are strings by [@​evanrittenhouse](https://github.com/evanrittenhouse) in [https://github.com/charliermarsh/ruff/pull/4834](https://github.com/charliermarsh/ruff/pull/4834) - Add some exceptions for FBT003 ([#​3247](https://github.com/charliermarsh/ruff/issues/3247)) by [@​allisonkarlitskaya](https://github.com/allisonkarlitskaya) in [https://github.com/charliermarsh/ruff/pull/4867](https://github.com/charliermarsh/ruff/pull/4867) - Avoid running RUF100 rules when code contains syntax errors by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4869](https://github.com/charliermarsh/ruff/pull/4869) - Avoid index-out-of-bands panic for positional placeholders by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4872](https://github.com/charliermarsh/ruff/pull/4872) - Remove destructive fixes for F523 by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4883](https://github.com/charliermarsh/ruff/pull/4883) - Respect shadowed exports in `__all__` by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4885](https://github.com/charliermarsh/ruff/pull/4885) - Track symbol deletions separately from bindings by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4888](https://github.com/charliermarsh/ruff/pull/4888) - Change fixable_set to include RuleSelector::All/Nursery by [@​evanrittenhouse](https://github.com/evanrittenhouse) in [https://github.com/charliermarsh/ruff/pull/4852](https://github.com/charliermarsh/ruff/pull/4852) #### New Contributors - [@​bersbersbers](https://github.com/bersbersbers) made their first contribution in [https://github.com/charliermarsh/ruff/pull/4644](https://github.com/charliermarsh/ruff/pull/4644) - [@​jlaneve](https://github.com/jlaneve) made their first contribution in [https://github.com/charliermarsh/ruff/pull/4690](https://github.com/charliermarsh/ruff/pull/4690) - [@​suharnikov](https://github.com/suharnikov) made their first contribution in [https://github.com/charliermarsh/ruff/pull/4678](https://github.com/charliermarsh/ruff/pull/4678) - [@​alexfikl](https://github.com/alexfikl) made their first contribution in [https://github.com/charliermarsh/ruff/pull/4752](https://github.com/charliermarsh/ruff/pull/4752) - [@​allisonkarlitskaya](https://github.com/allisonkarlitskaya) made their first contribution in [https://github.com/charliermarsh/ruff/pull/4867](https://github.com/charliermarsh/ruff/pull/4867) - [@​Ryang20718](https://github.com/Ryang20718) made their first contribution in [https://github.com/charliermarsh/ruff/pull/4854](https://github.com/charliermarsh/ruff/pull/4854) - [@​addisoncrump](https://github.com/addisoncrump) made their first contribution in [https://github.com/charliermarsh/ruff/pull/4893](https://github.com/charliermarsh/ruff/pull/4893) **Full Changelog**: astral-sh/ruff@v0.0.270...v0.0.271 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/ixm-one/pytest-cmake-presets). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4xMTAuMCIsInVwZGF0ZWRJblZlciI6IjM1LjExMC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9--> Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [ruff](https://github.com/charliermarsh/ruff) ([changelog](https://github.com/charliermarsh/ruff/releases)) | `0.0.270` -> `0.0.272` | [![age](https://badges.renovateapi.com/packages/pypi/ruff/0.0.272/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/ruff/0.0.272/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/ruff/0.0.272/compatibility-slim/0.0.270)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/ruff/0.0.272/confidence-slim/0.0.270)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>charliermarsh/ruff</summary> ### [`v0.0.272`](https://github.com/astral-sh/ruff/releases/tag/v0.0.272) [Compare Source](https://github.com/charliermarsh/ruff/compare/v0.0.271...v0.0.272) <!-- Release notes generated using configuration in .github/release.yml at main --> #### What's Changed ##### Breaking Changes - Move flake8-fixme rules to FIX prefix by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4917](https://github.com/charliermarsh/ruff/pull/4917) ##### Rules - \[`flake8-pyi`] Implement PYI050 by [@​density](https://github.com/density) in [https://github.com/charliermarsh/ruff/pull/4884](https://github.com/charliermarsh/ruff/pull/4884) ##### Bug Fixes - Avoid attributing runtime references to module-level imports by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4942](https://github.com/charliermarsh/ruff/pull/4942) - Skip class scopes when resolving nonlocal references by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4943](https://github.com/charliermarsh/ruff/pull/4943) - Apply `dict.get` fix before ternary rewrite by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4944](https://github.com/charliermarsh/ruff/pull/4944) - Handle implicit string concatenations in conversion-flag rewrites by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4947](https://github.com/charliermarsh/ruff/pull/4947) - Make `C413` fix as suggested for `reversed` call by [@​dhruvmanila](https://github.com/dhruvmanila) in [https://github.com/charliermarsh/ruff/pull/4891](https://github.com/charliermarsh/ruff/pull/4891) - ignore if using infinite iterators in `B905` by [@​kyoto7250](https://github.com/kyoto7250) in [https://github.com/charliermarsh/ruff/pull/4914](https://github.com/charliermarsh/ruff/pull/4914) **Full Changelog**: astral-sh/ruff@v0.0.271...v0.0.272 ### [`v0.0.271`](https://github.com/astral-sh/ruff/releases/tag/v0.0.271) [Compare Source](https://github.com/charliermarsh/ruff/compare/v0.0.270...v0.0.271) <!-- Release notes generated using configuration in .github/release.yml at main --> #### What's Changed ##### Rules - Add autofix for flake8-type-checking by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4742](https://github.com/charliermarsh/ruff/pull/4742) - \[`airflow`] Add AIR001: task variable name should be same as task_id arg by [@​jlaneve](https://github.com/jlaneve) in [https://github.com/charliermarsh/ruff/pull/4687](https://github.com/charliermarsh/ruff/pull/4687) - \[`flake8-bandit`] Implement S609, linux_commands_wildcard_injection by [@​scop](https://github.com/scop) in [https://github.com/charliermarsh/ruff/pull/4504](https://github.com/charliermarsh/ruff/pull/4504) - \[`flake8-bugbear`] Move duplicate-value rule to flake8-bugbear by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4882](https://github.com/charliermarsh/ruff/pull/4882) - \[`flake8-fixme`] Implement `flake8_fixme` and refactor `TodoDirective` by [@​evanrittenhouse](https://github.com/evanrittenhouse) in [https://github.com/charliermarsh/ruff/pull/4681](https://github.com/charliermarsh/ruff/pull/4681) - \[`flake8-future-annotations`] Implement `FA102` by [@​akx](https://github.com/akx) in [https://github.com/charliermarsh/ruff/pull/4702](https://github.com/charliermarsh/ruff/pull/4702) - \[`flake8-pyi`] Add PYI024 for `flake8-pyi` plugin by [@​qdegraaf](https://github.com/qdegraaf) in [https://github.com/charliermarsh/ruff/pull/4756](https://github.com/charliermarsh/ruff/pull/4756) - \[`flake8-pyi`] Add PYI034 for `flake8-pyi` plugin by [@​qdegraaf](https://github.com/qdegraaf) in [https://github.com/charliermarsh/ruff/pull/4764](https://github.com/charliermarsh/ruff/pull/4764) - \[`flake8-pyi`] Add `PYI032` rule with autofix by [@​qdegraaf](https://github.com/qdegraaf) in [https://github.com/charliermarsh/ruff/pull/4695](https://github.com/charliermarsh/ruff/pull/4695) - \[`flake8-pyi`] Add autofix for PYI010 by [@​qdegraaf](https://github.com/qdegraaf) in [https://github.com/charliermarsh/ruff/pull/4634](https://github.com/charliermarsh/ruff/pull/4634) - \[`flake8-pyi`] Implement PYI029 by [@​density](https://github.com/density) in [https://github.com/charliermarsh/ruff/pull/4851](https://github.com/charliermarsh/ruff/pull/4851) - \[`flake8-pyi`] Implement PYI035 by [@​density](https://github.com/density) in [https://github.com/charliermarsh/ruff/pull/4820](https://github.com/charliermarsh/ruff/pull/4820) - \[`flake8-pyi`] Implement PYI048 for `flake8-pyi` plugin by [@​qdegraaf](https://github.com/qdegraaf) in [https://github.com/charliermarsh/ruff/pull/4645](https://github.com/charliermarsh/ruff/pull/4645) - \[`flake8-pyi`] Implement PYI053 by [@​density](https://github.com/density) in [https://github.com/charliermarsh/ruff/pull/4770](https://github.com/charliermarsh/ruff/pull/4770) - \[`flake8-pyi`] Implement PYI054 by [@​density](https://github.com/density) in [https://github.com/charliermarsh/ruff/pull/4775](https://github.com/charliermarsh/ruff/pull/4775) - \[`flake8-pyi`] Implement `PYI025` by [@​qdegraaf](https://github.com/qdegraaf) in [https://github.com/charliermarsh/ruff/pull/4791](https://github.com/charliermarsh/ruff/pull/4791) - \[`flake8-pyi`] Implement `PYI045` by [@​density](https://github.com/density) in [https://github.com/charliermarsh/ruff/pull/4700](https://github.com/charliermarsh/ruff/pull/4700) - \[`pylint`] Add Pylint rule `C0208` (`use-sequence-for-iteration`) as `PLC0208` (`iteration-over-set`) by [@​tjkuson](https://github.com/tjkuson) in [https://github.com/charliermarsh/ruff/pull/4706](https://github.com/charliermarsh/ruff/pull/4706) - \[`pylint`] Add autofix for `PLR1701` (repeated-isinstance-calls) by [@​dhruvmanila](https://github.com/dhruvmanila) in [https://github.com/charliermarsh/ruff/pull/4792](https://github.com/charliermarsh/ruff/pull/4792) - \[`pylint`] Implement Pylint's `yield-inside-async-function` rule (`PLE1700`) by [@​chanman3388](https://github.com/chanman3388) in [https://github.com/charliermarsh/ruff/pull/4668](https://github.com/charliermarsh/ruff/pull/4668) - \[`pylint`] implement E307 for pylint invalid str return type by [@​Ryang20718](https://github.com/Ryang20718) in [https://github.com/charliermarsh/ruff/pull/4854](https://github.com/charliermarsh/ruff/pull/4854) - \[`ruff`] Lint pyproject.toml by [@​konstin](https://github.com/konstin) in [https://github.com/charliermarsh/ruff/pull/4496](https://github.com/charliermarsh/ruff/pull/4496) - \[`tryceratops`] Ignore error calls with `exc_info` in TRY400 by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4797](https://github.com/charliermarsh/ruff/pull/4797) ##### Settings - Add `pyflakes.extend-generics` setting by [@​JonathanPlasse](https://github.com/JonathanPlasse) in [https://github.com/charliermarsh/ruff/pull/4677](https://github.com/charliermarsh/ruff/pull/4677) ##### Bug Fixes - Fix PLW3301 false positive single argument nested min/max by [@​JonathanPlasse](https://github.com/JonathanPlasse) in [https://github.com/charliermarsh/ruff/pull/4683](https://github.com/charliermarsh/ruff/pull/4683) - Handle dotted alias imports to check for implicit imports by [@​dhruvmanila](https://github.com/dhruvmanila) in [https://github.com/charliermarsh/ruff/pull/4685](https://github.com/charliermarsh/ruff/pull/4685) - Flag empty strings in flake8-errmsg rules by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4745](https://github.com/charliermarsh/ruff/pull/4745) - Exclude function definition from too-many-statements rule by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4794](https://github.com/charliermarsh/ruff/pull/4794) - Preserve quotes in F523 fixer by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4836](https://github.com/charliermarsh/ruff/pull/4836) - Fix round-tripping of nested functions by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4875](https://github.com/charliermarsh/ruff/pull/4875) - Avoid early-exit in explicit-f-string-type-conversion by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4886](https://github.com/charliermarsh/ruff/pull/4886) - Avoid no-op fix for nested with expressions by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4906](https://github.com/charliermarsh/ruff/pull/4906) - Fix UP036 auto-fix error by [@​JonathanPlasse](https://github.com/JonathanPlasse) in [https://github.com/charliermarsh/ruff/pull/4679](https://github.com/charliermarsh/ruff/pull/4679) - Use class name as range for `B024` by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4647](https://github.com/charliermarsh/ruff/pull/4647) - Change TODO directive detection to work with multiple pound signs on the same line by [@​evanrittenhouse](https://github.com/evanrittenhouse) in [https://github.com/charliermarsh/ruff/pull/4558](https://github.com/charliermarsh/ruff/pull/4558) - Allow more immutable funcs for RUF009 by [@​qdegraaf](https://github.com/qdegraaf) in [https://github.com/charliermarsh/ruff/pull/4660](https://github.com/charliermarsh/ruff/pull/4660) - Avoid using typing-imported symbols for runtime edits by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4649](https://github.com/charliermarsh/ruff/pull/4649) - Fix `async for` formatting by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4675](https://github.com/charliermarsh/ruff/pull/4675) - Ignore **setattr** in FBT003 by [@​alexfikl](https://github.com/alexfikl) in [https://github.com/charliermarsh/ruff/pull/4752](https://github.com/charliermarsh/ruff/pull/4752) - Include ImportError in non-fixable try-catch imports by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4793](https://github.com/charliermarsh/ruff/pull/4793) - Avoid extra newline between diagnostics in grouped mode by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4776](https://github.com/charliermarsh/ruff/pull/4776) - Avoid enforcing native-literals rule within nested f-strings by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4488](https://github.com/charliermarsh/ruff/pull/4488) - Respect mixed variable assignment in RET504 by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4835](https://github.com/charliermarsh/ruff/pull/4835) - Make FLY002 autofix into a constant string instead of an f-string if all `join()` arguments are strings by [@​evanrittenhouse](https://github.com/evanrittenhouse) in [https://github.com/charliermarsh/ruff/pull/4834](https://github.com/charliermarsh/ruff/pull/4834) - Add some exceptions for FBT003 ([#​3247](https://github.com/charliermarsh/ruff/issues/3247)) by [@​allisonkarlitskaya](https://github.com/allisonkarlitskaya) in [https://github.com/charliermarsh/ruff/pull/4867](https://github.com/charliermarsh/ruff/pull/4867) - Avoid running RUF100 rules when code contains syntax errors by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4869](https://github.com/charliermarsh/ruff/pull/4869) - Avoid index-out-of-bands panic for positional placeholders by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4872](https://github.com/charliermarsh/ruff/pull/4872) - Remove destructive fixes for F523 by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4883](https://github.com/charliermarsh/ruff/pull/4883) - Respect shadowed exports in `__all__` by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4885](https://github.com/charliermarsh/ruff/pull/4885) - Track symbol deletions separately from bindings by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4888](https://github.com/charliermarsh/ruff/pull/4888) - Change fixable_set to include RuleSelector::All/Nursery by [@​evanrittenhouse](https://github.com/evanrittenhouse) in [https://github.com/charliermarsh/ruff/pull/4852](https://github.com/charliermarsh/ruff/pull/4852) #### New Contributors - [@​bersbersbers](https://github.com/bersbersbers) made their first contribution in [https://github.com/charliermarsh/ruff/pull/4644](https://github.com/charliermarsh/ruff/pull/4644) - [@​jlaneve](https://github.com/jlaneve) made their first contribution in [https://github.com/charliermarsh/ruff/pull/4690](https://github.com/charliermarsh/ruff/pull/4690) - [@​suharnikov](https://github.com/suharnikov) made their first contribution in [https://github.com/charliermarsh/ruff/pull/4678](https://github.com/charliermarsh/ruff/pull/4678) - [@​alexfikl](https://github.com/alexfikl) made their first contribution in [https://github.com/charliermarsh/ruff/pull/4752](https://github.com/charliermarsh/ruff/pull/4752) - [@​allisonkarlitskaya](https://github.com/allisonkarlitskaya) made their first contribution in [https://github.com/charliermarsh/ruff/pull/4867](https://github.com/charliermarsh/ruff/pull/4867) - [@​Ryang20718](https://github.com/Ryang20718) made their first contribution in [https://github.com/charliermarsh/ruff/pull/4854](https://github.com/charliermarsh/ruff/pull/4854) - [@​addisoncrump](https://github.com/addisoncrump) made their first contribution in [https://github.com/charliermarsh/ruff/pull/4893](https://github.com/charliermarsh/ruff/pull/4893) **Full Changelog**: astral-sh/ruff@v0.0.270...v0.0.271 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/jankatins/pr-workflow-example). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4xMTAuMCIsInVwZGF0ZWRJblZlciI6IjM1LjExMC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [ruff](https://github.com/charliermarsh/ruff) ([changelog](https://github.com/charliermarsh/ruff/releases)) | `==0.0.270` -> `==0.0.272` | [![age](https://badges.renovateapi.com/packages/pypi/ruff/0.0.272/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/ruff/0.0.272/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/ruff/0.0.272/compatibility-slim/0.0.270)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/ruff/0.0.272/confidence-slim/0.0.270)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>charliermarsh/ruff</summary> ### [`v0.0.272`](https://github.com/astral-sh/ruff/releases/tag/v0.0.272) [Compare Source](https://github.com/charliermarsh/ruff/compare/v0.0.271...v0.0.272) <!-- Release notes generated using configuration in .github/release.yml at main --> #### What's Changed ##### Breaking Changes - Move flake8-fixme rules to FIX prefix by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4917](https://github.com/charliermarsh/ruff/pull/4917) ##### Rules - \[`flake8-pyi`] Implement PYI050 by [@​density](https://github.com/density) in [https://github.com/charliermarsh/ruff/pull/4884](https://github.com/charliermarsh/ruff/pull/4884) ##### Bug Fixes - Avoid attributing runtime references to module-level imports by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4942](https://github.com/charliermarsh/ruff/pull/4942) - Skip class scopes when resolving nonlocal references by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4943](https://github.com/charliermarsh/ruff/pull/4943) - Apply `dict.get` fix before ternary rewrite by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4944](https://github.com/charliermarsh/ruff/pull/4944) - Handle implicit string concatenations in conversion-flag rewrites by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4947](https://github.com/charliermarsh/ruff/pull/4947) - Make `C413` fix as suggested for `reversed` call by [@​dhruvmanila](https://github.com/dhruvmanila) in [https://github.com/charliermarsh/ruff/pull/4891](https://github.com/charliermarsh/ruff/pull/4891) - ignore if using infinite iterators in `B905` by [@​kyoto7250](https://github.com/kyoto7250) in [https://github.com/charliermarsh/ruff/pull/4914](https://github.com/charliermarsh/ruff/pull/4914) **Full Changelog**: astral-sh/ruff@v0.0.271...v0.0.272 ### [`v0.0.271`](https://github.com/astral-sh/ruff/releases/tag/v0.0.271) [Compare Source](https://github.com/charliermarsh/ruff/compare/v0.0.270...v0.0.271) <!-- Release notes generated using configuration in .github/release.yml at main --> #### What's Changed ##### Rules - Add autofix for flake8-type-checking by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4742](https://github.com/charliermarsh/ruff/pull/4742) - \[`airflow`] Add AIR001: task variable name should be same as task_id arg by [@​jlaneve](https://github.com/jlaneve) in [https://github.com/charliermarsh/ruff/pull/4687](https://github.com/charliermarsh/ruff/pull/4687) - \[`flake8-bandit`] Implement S609, linux_commands_wildcard_injection by [@​scop](https://github.com/scop) in [https://github.com/charliermarsh/ruff/pull/4504](https://github.com/charliermarsh/ruff/pull/4504) - \[`flake8-bugbear`] Move duplicate-value rule to flake8-bugbear by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4882](https://github.com/charliermarsh/ruff/pull/4882) - \[`flake8-fixme`] Implement `flake8_fixme` and refactor `TodoDirective` by [@​evanrittenhouse](https://github.com/evanrittenhouse) in [https://github.com/charliermarsh/ruff/pull/4681](https://github.com/charliermarsh/ruff/pull/4681) - \[`flake8-future-annotations`] Implement `FA102` by [@​akx](https://github.com/akx) in [https://github.com/charliermarsh/ruff/pull/4702](https://github.com/charliermarsh/ruff/pull/4702) - \[`flake8-pyi`] Add PYI024 for `flake8-pyi` plugin by [@​qdegraaf](https://github.com/qdegraaf) in [https://github.com/charliermarsh/ruff/pull/4756](https://github.com/charliermarsh/ruff/pull/4756) - \[`flake8-pyi`] Add PYI034 for `flake8-pyi` plugin by [@​qdegraaf](https://github.com/qdegraaf) in [https://github.com/charliermarsh/ruff/pull/4764](https://github.com/charliermarsh/ruff/pull/4764) - \[`flake8-pyi`] Add `PYI032` rule with autofix by [@​qdegraaf](https://github.com/qdegraaf) in [https://github.com/charliermarsh/ruff/pull/4695](https://github.com/charliermarsh/ruff/pull/4695) - \[`flake8-pyi`] Add autofix for PYI010 by [@​qdegraaf](https://github.com/qdegraaf) in [https://github.com/charliermarsh/ruff/pull/4634](https://github.com/charliermarsh/ruff/pull/4634) - \[`flake8-pyi`] Implement PYI029 by [@​density](https://github.com/density) in [https://github.com/charliermarsh/ruff/pull/4851](https://github.com/charliermarsh/ruff/pull/4851) - \[`flake8-pyi`] Implement PYI035 by [@​density](https://github.com/density) in [https://github.com/charliermarsh/ruff/pull/4820](https://github.com/charliermarsh/ruff/pull/4820) - \[`flake8-pyi`] Implement PYI048 for `flake8-pyi` plugin by [@​qdegraaf](https://github.com/qdegraaf) in [https://github.com/charliermarsh/ruff/pull/4645](https://github.com/charliermarsh/ruff/pull/4645) - \[`flake8-pyi`] Implement PYI053 by [@​density](https://github.com/density) in [https://github.com/charliermarsh/ruff/pull/4770](https://github.com/charliermarsh/ruff/pull/4770) - \[`flake8-pyi`] Implement PYI054 by [@​density](https://github.com/density) in [https://github.com/charliermarsh/ruff/pull/4775](https://github.com/charliermarsh/ruff/pull/4775) - \[`flake8-pyi`] Implement `PYI025` by [@​qdegraaf](https://github.com/qdegraaf) in [https://github.com/charliermarsh/ruff/pull/4791](https://github.com/charliermarsh/ruff/pull/4791) - \[`flake8-pyi`] Implement `PYI045` by [@​density](https://github.com/density) in [https://github.com/charliermarsh/ruff/pull/4700](https://github.com/charliermarsh/ruff/pull/4700) - \[`pylint`] Add Pylint rule `C0208` (`use-sequence-for-iteration`) as `PLC0208` (`iteration-over-set`) by [@​tjkuson](https://github.com/tjkuson) in [https://github.com/charliermarsh/ruff/pull/4706](https://github.com/charliermarsh/ruff/pull/4706) - \[`pylint`] Add autofix for `PLR1701` (repeated-isinstance-calls) by [@​dhruvmanila](https://github.com/dhruvmanila) in [https://github.com/charliermarsh/ruff/pull/4792](https://github.com/charliermarsh/ruff/pull/4792) - \[`pylint`] Implement Pylint's `yield-inside-async-function` rule (`PLE1700`) by [@​chanman3388](https://github.com/chanman3388) in [https://github.com/charliermarsh/ruff/pull/4668](https://github.com/charliermarsh/ruff/pull/4668) - \[`pylint`] implement E307 for pylint invalid str return type by [@​Ryang20718](https://github.com/Ryang20718) in [https://github.com/charliermarsh/ruff/pull/4854](https://github.com/charliermarsh/ruff/pull/4854) - \[`ruff`] Lint pyproject.toml by [@​konstin](https://github.com/konstin) in [https://github.com/charliermarsh/ruff/pull/4496](https://github.com/charliermarsh/ruff/pull/4496) - \[`tryceratops`] Ignore error calls with `exc_info` in TRY400 by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4797](https://github.com/charliermarsh/ruff/pull/4797) ##### Settings - Add `pyflakes.extend-generics` setting by [@​JonathanPlasse](https://github.com/JonathanPlasse) in [https://github.com/charliermarsh/ruff/pull/4677](https://github.com/charliermarsh/ruff/pull/4677) ##### Bug Fixes - Fix PLW3301 false positive single argument nested min/max by [@​JonathanPlasse](https://github.com/JonathanPlasse) in [https://github.com/charliermarsh/ruff/pull/4683](https://github.com/charliermarsh/ruff/pull/4683) - Handle dotted alias imports to check for implicit imports by [@​dhruvmanila](https://github.com/dhruvmanila) in [https://github.com/charliermarsh/ruff/pull/4685](https://github.com/charliermarsh/ruff/pull/4685) - Flag empty strings in flake8-errmsg rules by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4745](https://github.com/charliermarsh/ruff/pull/4745) - Exclude function definition from too-many-statements rule by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4794](https://github.com/charliermarsh/ruff/pull/4794) - Preserve quotes in F523 fixer by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4836](https://github.com/charliermarsh/ruff/pull/4836) - Fix round-tripping of nested functions by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4875](https://github.com/charliermarsh/ruff/pull/4875) - Avoid early-exit in explicit-f-string-type-conversion by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4886](https://github.com/charliermarsh/ruff/pull/4886) - Avoid no-op fix for nested with expressions by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4906](https://github.com/charliermarsh/ruff/pull/4906) - Fix UP036 auto-fix error by [@​JonathanPlasse](https://github.com/JonathanPlasse) in [https://github.com/charliermarsh/ruff/pull/4679](https://github.com/charliermarsh/ruff/pull/4679) - Use class name as range for `B024` by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4647](https://github.com/charliermarsh/ruff/pull/4647) - Change TODO directive detection to work with multiple pound signs on the same line by [@​evanrittenhouse](https://github.com/evanrittenhouse) in [https://github.com/charliermarsh/ruff/pull/4558](https://github.com/charliermarsh/ruff/pull/4558) - Allow more immutable funcs for RUF009 by [@​qdegraaf](https://github.com/qdegraaf) in [https://github.com/charliermarsh/ruff/pull/4660](https://github.com/charliermarsh/ruff/pull/4660) - Avoid using typing-imported symbols for runtime edits by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4649](https://github.com/charliermarsh/ruff/pull/4649) - Fix `async for` formatting by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4675](https://github.com/charliermarsh/ruff/pull/4675) - Ignore **setattr** in FBT003 by [@​alexfikl](https://github.com/alexfikl) in [https://github.com/charliermarsh/ruff/pull/4752](https://github.com/charliermarsh/ruff/pull/4752) - Include ImportError in non-fixable try-catch imports by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4793](https://github.com/charliermarsh/ruff/pull/4793) - Avoid extra newline between diagnostics in grouped mode by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4776](https://github.com/charliermarsh/ruff/pull/4776) - Avoid enforcing native-literals rule within nested f-strings by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4488](https://github.com/charliermarsh/ruff/pull/4488) - Respect mixed variable assignment in RET504 by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4835](https://github.com/charliermarsh/ruff/pull/4835) - Make FLY002 autofix into a constant string instead of an f-string if all `join()` arguments are strings by [@​evanrittenhouse](https://github.com/evanrittenhouse) in [https://github.com/charliermarsh/ruff/pull/4834](https://github.com/charliermarsh/ruff/pull/4834) - Add some exceptions for FBT003 ([#​3247](https://github.com/charliermarsh/ruff/issues/3247)) by [@​allisonkarlitskaya](https://github.com/allisonkarlitskaya) in [https://github.com/charliermarsh/ruff/pull/4867](https://github.com/charliermarsh/ruff/pull/4867) - Avoid running RUF100 rules when code contains syntax errors by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4869](https://github.com/charliermarsh/ruff/pull/4869) - Avoid index-out-of-bands panic for positional placeholders by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4872](https://github.com/charliermarsh/ruff/pull/4872) - Remove destructive fixes for F523 by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4883](https://github.com/charliermarsh/ruff/pull/4883) - Respect shadowed exports in `__all__` by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4885](https://github.com/charliermarsh/ruff/pull/4885) - Track symbol deletions separately from bindings by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4888](https://github.com/charliermarsh/ruff/pull/4888) - Change fixable_set to include RuleSelector::All/Nursery by [@​evanrittenhouse](https://github.com/evanrittenhouse) in [https://github.com/charliermarsh/ruff/pull/4852](https://github.com/charliermarsh/ruff/pull/4852) #### New Contributors - [@​bersbersbers](https://github.com/bersbersbers) made their first contribution in [https://github.com/charliermarsh/ruff/pull/4644](https://github.com/charliermarsh/ruff/pull/4644) - [@​jlaneve](https://github.com/jlaneve) made their first contribution in [https://github.com/charliermarsh/ruff/pull/4690](https://github.com/charliermarsh/ruff/pull/4690) - [@​suharnikov](https://github.com/suharnikov) made their first contribution in [https://github.com/charliermarsh/ruff/pull/4678](https://github.com/charliermarsh/ruff/pull/4678) - [@​alexfikl](https://github.com/alexfikl) made their first contribution in [https://github.com/charliermarsh/ruff/pull/4752](https://github.com/charliermarsh/ruff/pull/4752) - [@​allisonkarlitskaya](https://github.com/allisonkarlitskaya) made their first contribution in [https://github.com/charliermarsh/ruff/pull/4867](https://github.com/charliermarsh/ruff/pull/4867) - [@​Ryang20718](https://github.com/Ryang20718) made their first contribution in [https://github.com/charliermarsh/ruff/pull/4854](https://github.com/charliermarsh/ruff/pull/4854) - [@​addisoncrump](https://github.com/addisoncrump) made their first contribution in [https://github.com/charliermarsh/ruff/pull/4893](https://github.com/charliermarsh/ruff/pull/4893) **Full Changelog**: astral-sh/ruff@v0.0.270...v0.0.271 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/allenporter/flux-local). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4xMTAuMCIsInVwZGF0ZWRJblZlciI6IjM1LjExMC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [ruff](https://github.com/charliermarsh/ruff) ([changelog](https://github.com/charliermarsh/ruff/releases)) | `==0.0.270` -> `==0.0.272` | [![age](https://badges.renovateapi.com/packages/pypi/ruff/0.0.272/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/ruff/0.0.272/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/ruff/0.0.272/compatibility-slim/0.0.270)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/ruff/0.0.272/confidence-slim/0.0.270)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>charliermarsh/ruff</summary> ### [`v0.0.272`](https://github.com/astral-sh/ruff/releases/tag/v0.0.272) [Compare Source](https://github.com/charliermarsh/ruff/compare/v0.0.271...v0.0.272) <!-- Release notes generated using configuration in .github/release.yml at main --> #### What's Changed ##### Breaking Changes - Move flake8-fixme rules to FIX prefix by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4917](https://github.com/charliermarsh/ruff/pull/4917) ##### Rules - \[`flake8-pyi`] Implement PYI050 by [@​density](https://github.com/density) in [https://github.com/charliermarsh/ruff/pull/4884](https://github.com/charliermarsh/ruff/pull/4884) ##### Bug Fixes - Avoid attributing runtime references to module-level imports by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4942](https://github.com/charliermarsh/ruff/pull/4942) - Skip class scopes when resolving nonlocal references by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4943](https://github.com/charliermarsh/ruff/pull/4943) - Apply `dict.get` fix before ternary rewrite by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4944](https://github.com/charliermarsh/ruff/pull/4944) - Handle implicit string concatenations in conversion-flag rewrites by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4947](https://github.com/charliermarsh/ruff/pull/4947) - Make `C413` fix as suggested for `reversed` call by [@​dhruvmanila](https://github.com/dhruvmanila) in [https://github.com/charliermarsh/ruff/pull/4891](https://github.com/charliermarsh/ruff/pull/4891) - ignore if using infinite iterators in `B905` by [@​kyoto7250](https://github.com/kyoto7250) in [https://github.com/charliermarsh/ruff/pull/4914](https://github.com/charliermarsh/ruff/pull/4914) **Full Changelog**: astral-sh/ruff@v0.0.271...v0.0.272 ### [`v0.0.271`](https://github.com/astral-sh/ruff/releases/tag/v0.0.271) [Compare Source](https://github.com/charliermarsh/ruff/compare/v0.0.270...v0.0.271) <!-- Release notes generated using configuration in .github/release.yml at main --> #### What's Changed ##### Rules - Add autofix for flake8-type-checking by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4742](https://github.com/charliermarsh/ruff/pull/4742) - \[`airflow`] Add AIR001: task variable name should be same as task_id arg by [@​jlaneve](https://github.com/jlaneve) in [https://github.com/charliermarsh/ruff/pull/4687](https://github.com/charliermarsh/ruff/pull/4687) - \[`flake8-bandit`] Implement S609, linux_commands_wildcard_injection by [@​scop](https://github.com/scop) in [https://github.com/charliermarsh/ruff/pull/4504](https://github.com/charliermarsh/ruff/pull/4504) - \[`flake8-bugbear`] Move duplicate-value rule to flake8-bugbear by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4882](https://github.com/charliermarsh/ruff/pull/4882) - \[`flake8-fixme`] Implement `flake8_fixme` and refactor `TodoDirective` by [@​evanrittenhouse](https://github.com/evanrittenhouse) in [https://github.com/charliermarsh/ruff/pull/4681](https://github.com/charliermarsh/ruff/pull/4681) - \[`flake8-future-annotations`] Implement `FA102` by [@​akx](https://github.com/akx) in [https://github.com/charliermarsh/ruff/pull/4702](https://github.com/charliermarsh/ruff/pull/4702) - \[`flake8-pyi`] Add PYI024 for `flake8-pyi` plugin by [@​qdegraaf](https://github.com/qdegraaf) in [https://github.com/charliermarsh/ruff/pull/4756](https://github.com/charliermarsh/ruff/pull/4756) - \[`flake8-pyi`] Add PYI034 for `flake8-pyi` plugin by [@​qdegraaf](https://github.com/qdegraaf) in [https://github.com/charliermarsh/ruff/pull/4764](https://github.com/charliermarsh/ruff/pull/4764) - \[`flake8-pyi`] Add `PYI032` rule with autofix by [@​qdegraaf](https://github.com/qdegraaf) in [https://github.com/charliermarsh/ruff/pull/4695](https://github.com/charliermarsh/ruff/pull/4695) - \[`flake8-pyi`] Add autofix for PYI010 by [@​qdegraaf](https://github.com/qdegraaf) in [https://github.com/charliermarsh/ruff/pull/4634](https://github.com/charliermarsh/ruff/pull/4634) - \[`flake8-pyi`] Implement PYI029 by [@​density](https://github.com/density) in [https://github.com/charliermarsh/ruff/pull/4851](https://github.com/charliermarsh/ruff/pull/4851) - \[`flake8-pyi`] Implement PYI035 by [@​density](https://github.com/density) in [https://github.com/charliermarsh/ruff/pull/4820](https://github.com/charliermarsh/ruff/pull/4820) - \[`flake8-pyi`] Implement PYI048 for `flake8-pyi` plugin by [@​qdegraaf](https://github.com/qdegraaf) in [https://github.com/charliermarsh/ruff/pull/4645](https://github.com/charliermarsh/ruff/pull/4645) - \[`flake8-pyi`] Implement PYI053 by [@​density](https://github.com/density) in [https://github.com/charliermarsh/ruff/pull/4770](https://github.com/charliermarsh/ruff/pull/4770) - \[`flake8-pyi`] Implement PYI054 by [@​density](https://github.com/density) in [https://github.com/charliermarsh/ruff/pull/4775](https://github.com/charliermarsh/ruff/pull/4775) - \[`flake8-pyi`] Implement `PYI025` by [@​qdegraaf](https://github.com/qdegraaf) in [https://github.com/charliermarsh/ruff/pull/4791](https://github.com/charliermarsh/ruff/pull/4791) - \[`flake8-pyi`] Implement `PYI045` by [@​density](https://github.com/density) in [https://github.com/charliermarsh/ruff/pull/4700](https://github.com/charliermarsh/ruff/pull/4700) - \[`pylint`] Add Pylint rule `C0208` (`use-sequence-for-iteration`) as `PLC0208` (`iteration-over-set`) by [@​tjkuson](https://github.com/tjkuson) in [https://github.com/charliermarsh/ruff/pull/4706](https://github.com/charliermarsh/ruff/pull/4706) - \[`pylint`] Add autofix for `PLR1701` (repeated-isinstance-calls) by [@​dhruvmanila](https://github.com/dhruvmanila) in [https://github.com/charliermarsh/ruff/pull/4792](https://github.com/charliermarsh/ruff/pull/4792) - \[`pylint`] Implement Pylint's `yield-inside-async-function` rule (`PLE1700`) by [@​chanman3388](https://github.com/chanman3388) in [https://github.com/charliermarsh/ruff/pull/4668](https://github.com/charliermarsh/ruff/pull/4668) - \[`pylint`] implement E307 for pylint invalid str return type by [@​Ryang20718](https://github.com/Ryang20718) in [https://github.com/charliermarsh/ruff/pull/4854](https://github.com/charliermarsh/ruff/pull/4854) - \[`ruff`] Lint pyproject.toml by [@​konstin](https://github.com/konstin) in [https://github.com/charliermarsh/ruff/pull/4496](https://github.com/charliermarsh/ruff/pull/4496) - \[`tryceratops`] Ignore error calls with `exc_info` in TRY400 by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4797](https://github.com/charliermarsh/ruff/pull/4797) ##### Settings - Add `pyflakes.extend-generics` setting by [@​JonathanPlasse](https://github.com/JonathanPlasse) in [https://github.com/charliermarsh/ruff/pull/4677](https://github.com/charliermarsh/ruff/pull/4677) ##### Bug Fixes - Fix PLW3301 false positive single argument nested min/max by [@​JonathanPlasse](https://github.com/JonathanPlasse) in [https://github.com/charliermarsh/ruff/pull/4683](https://github.com/charliermarsh/ruff/pull/4683) - Handle dotted alias imports to check for implicit imports by [@​dhruvmanila](https://github.com/dhruvmanila) in [https://github.com/charliermarsh/ruff/pull/4685](https://github.com/charliermarsh/ruff/pull/4685) - Flag empty strings in flake8-errmsg rules by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4745](https://github.com/charliermarsh/ruff/pull/4745) - Exclude function definition from too-many-statements rule by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4794](https://github.com/charliermarsh/ruff/pull/4794) - Preserve quotes in F523 fixer by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4836](https://github.com/charliermarsh/ruff/pull/4836) - Fix round-tripping of nested functions by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4875](https://github.com/charliermarsh/ruff/pull/4875) - Avoid early-exit in explicit-f-string-type-conversion by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4886](https://github.com/charliermarsh/ruff/pull/4886) - Avoid no-op fix for nested with expressions by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4906](https://github.com/charliermarsh/ruff/pull/4906) - Fix UP036 auto-fix error by [@​JonathanPlasse](https://github.com/JonathanPlasse) in [https://github.com/charliermarsh/ruff/pull/4679](https://github.com/charliermarsh/ruff/pull/4679) - Use class name as range for `B024` by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4647](https://github.com/charliermarsh/ruff/pull/4647) - Change TODO directive detection to work with multiple pound signs on the same line by [@​evanrittenhouse](https://github.com/evanrittenhouse) in [https://github.com/charliermarsh/ruff/pull/4558](https://github.com/charliermarsh/ruff/pull/4558) - Allow more immutable funcs for RUF009 by [@​qdegraaf](https://github.com/qdegraaf) in [https://github.com/charliermarsh/ruff/pull/4660](https://github.com/charliermarsh/ruff/pull/4660) - Avoid using typing-imported symbols for runtime edits by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4649](https://github.com/charliermarsh/ruff/pull/4649) - Fix `async for` formatting by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4675](https://github.com/charliermarsh/ruff/pull/4675) - Ignore **setattr** in FBT003 by [@​alexfikl](https://github.com/alexfikl) in [https://github.com/charliermarsh/ruff/pull/4752](https://github.com/charliermarsh/ruff/pull/4752) - Include ImportError in non-fixable try-catch imports by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4793](https://github.com/charliermarsh/ruff/pull/4793) - Avoid extra newline between diagnostics in grouped mode by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4776](https://github.com/charliermarsh/ruff/pull/4776) - Avoid enforcing native-literals rule within nested f-strings by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4488](https://github.com/charliermarsh/ruff/pull/4488) - Respect mixed variable assignment in RET504 by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4835](https://github.com/charliermarsh/ruff/pull/4835) - Make FLY002 autofix into a constant string instead of an f-string if all `join()` arguments are strings by [@​evanrittenhouse](https://github.com/evanrittenhouse) in [https://github.com/charliermarsh/ruff/pull/4834](https://github.com/charliermarsh/ruff/pull/4834) - Add some exceptions for FBT003 ([#​3247](https://github.com/charliermarsh/ruff/issues/3247)) by [@​allisonkarlitskaya](https://github.com/allisonkarlitskaya) in [https://github.com/charliermarsh/ruff/pull/4867](https://github.com/charliermarsh/ruff/pull/4867) - Avoid running RUF100 rules when code contains syntax errors by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4869](https://github.com/charliermarsh/ruff/pull/4869) - Avoid index-out-of-bands panic for positional placeholders by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4872](https://github.com/charliermarsh/ruff/pull/4872) - Remove destructive fixes for F523 by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4883](https://github.com/charliermarsh/ruff/pull/4883) - Respect shadowed exports in `__all__` by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4885](https://github.com/charliermarsh/ruff/pull/4885) - Track symbol deletions separately from bindings by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4888](https://github.com/charliermarsh/ruff/pull/4888) - Change fixable_set to include RuleSelector::All/Nursery by [@​evanrittenhouse](https://github.com/evanrittenhouse) in [https://github.com/charliermarsh/ruff/pull/4852](https://github.com/charliermarsh/ruff/pull/4852) #### New Contributors - [@​bersbersbers](https://github.com/bersbersbers) made their first contribution in [https://github.com/charliermarsh/ruff/pull/4644](https://github.com/charliermarsh/ruff/pull/4644) - [@​jlaneve](https://github.com/jlaneve) made their first contribution in [https://github.com/charliermarsh/ruff/pull/4690](https://github.com/charliermarsh/ruff/pull/4690) - [@​suharnikov](https://github.com/suharnikov) made their first contribution in [https://github.com/charliermarsh/ruff/pull/4678](https://github.com/charliermarsh/ruff/pull/4678) - [@​alexfikl](https://github.com/alexfikl) made their first contribution in [https://github.com/charliermarsh/ruff/pull/4752](https://github.com/charliermarsh/ruff/pull/4752) - [@​allisonkarlitskaya](https://github.com/allisonkarlitskaya) made their first contribution in [https://github.com/charliermarsh/ruff/pull/4867](https://github.com/charliermarsh/ruff/pull/4867) - [@​Ryang20718](https://github.com/Ryang20718) made their first contribution in [https://github.com/charliermarsh/ruff/pull/4854](https://github.com/charliermarsh/ruff/pull/4854) - [@​addisoncrump](https://github.com/addisoncrump) made their first contribution in [https://github.com/charliermarsh/ruff/pull/4893](https://github.com/charliermarsh/ruff/pull/4893) **Full Changelog**: astral-sh/ruff@v0.0.270...v0.0.271 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/allenporter/pyrainbird). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4xMTAuMCIsInVwZGF0ZWRJblZlciI6IjM1LjExMC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Summary
Adds autofix for:
Test Plan
cargo test
and reviewing the snapshotsI wanted to check the fix for multi-line funcs to, but this didn't work as PYI010 does not trigger on multi-line funcs quite explicitly due to:
I assume this is because Y048 checks and makes sure that all functions are one line. This rule does not exist in Ruff (yet). Unsure whether there was a specific reason for that. I could add the rule (it's an easy check) but then the question would be what the autofix should do if one rule is turned on and the other is turned off. It seems to me both the fix and check could be combined into one (i.e. if all stub funcs should only be
...
then all stub funcs which are anything but...
and any amount of lines, should trigger a Violation and could be replaced by...
). Let me know what is preferred here and I'll implement that