-
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
Ignore type aliases for RUF013 #5344
Conversation
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
fn is_known_type(call_path: &CallPath) -> bool { | ||
match call_path.as_slice() { | ||
["typing" | "typing_extensions" | "types", _] => true, | ||
_ => { | ||
is_standard_library_generic(call_path) | ||
|| is_pep_593_generic_type(call_path) | ||
|| is_immutable_non_generic_type(call_path) | ||
|| is_immutable_generic_type(call_path) | ||
} | ||
} | ||
} |
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.
\cc @charliermarsh I'm a bit torn on this. Is this enough or too much? Should we just go with either builtin or coming from known module which contains types? There are others apart from typing
or typing_extensions
such as collections
, types
, and even re
, io
, contextlib
, etc. These are covered in the above functions at a granular level.
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.
Hmm, I feel like we could accept anything that's builtin, or from typing_extensions
, or any standard-library module. Should we just check in KNOWN_STANDARD_LIBRARY
?
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.
Yeah, KNOWN_STANDARD_LIBRARY
makes more sense.
PR Check ResultsEcosystemℹ️ ecosystem check detected changes. (+0, -64, 0 error(s)) airflow (+0, -28)
- airflow/api_connexion/endpoints/connection_endpoint.py:118:18: RUF013 [*] PEP 484 prohibits implicit `Optional`
- airflow/api_connexion/endpoints/dag_endpoint.py:110:44: RUF013 [*] PEP 484 prohibits implicit `Optional`
- airflow/api_connexion/endpoints/pool_endpoint.py:86:18: RUF013 [*] PEP 484 prohibits implicit `Optional`
- airflow/api_connexion/endpoints/role_and_permission_endpoint.py:113:48: RUF013 [*] PEP 484 prohibits implicit `Optional`
- airflow/api_connexion/endpoints/user_endpoint.py:128:47: RUF013 [*] PEP 484 prohibits implicit `Optional`
- airflow/api_connexion/endpoints/variable_endpoint.py:102:18: RUF013 [*] PEP 484 prohibits implicit `Optional`
- airflow/kubernetes/pod_launcher_deprecated.py:73:22: RUF013 [*] PEP 484 prohibits implicit `Optional`
- airflow/metrics/otel_logger.py:177:15: RUF013 [*] PEP 484 prohibits implicit `Optional`
- airflow/metrics/otel_logger.py:203:15: RUF013 [*] PEP 484 prohibits implicit `Optional`
- airflow/metrics/otel_logger.py:231:15: RUF013 [*] PEP 484 prohibits implicit `Optional`
- airflow/metrics/otel_logger.py:263:15: RUF013 [*] PEP 484 prohibits implicit `Optional`
- airflow/metrics/otel_logger.py:278:15: RUF013 [*] PEP 484 prohibits implicit `Optional`
- airflow/metrics/otel_logger.py:307:50: RUF013 [*] PEP 484 prohibits implicit `Optional`
- airflow/metrics/otel_logger.py:322:50: RUF013 [*] PEP 484 prohibits implicit `Optional`
- airflow/metrics/otel_logger.py:351:52: RUF013 [*] PEP 484 prohibits implicit `Optional`
- airflow/metrics/otel_logger.py:373:49: RUF013 [*] PEP 484 prohibits implicit `Optional`
- airflow/metrics/otel_logger.py:77:47: RUF013 [*] PEP 484 prohibits implicit `Optional`
- airflow/models/dagbag.py:174:40: RUF013 [*] PEP 484 prohibits implicit `Optional`
- airflow/models/renderedtifields.py:178:30: RUF013 [*] PEP 484 prohibits implicit `Optional`
- airflow/models/variable.py:159:18: RUF013 [*] PEP 484 prohibits implicit `Optional`
- airflow/models/variable.py:188:18: RUF013 [*] PEP 484 prohibits implicit `Optional`
- airflow/models/variable.py:210:35: RUF013 [*] PEP 484 prohibits implicit `Optional`
- airflow/providers/amazon/aws/links/emr.py:51:59: RUF013 [*] PEP 484 prohibits implicit `Optional`
- airflow/providers/google/cloud/hooks/pubsub.py:181:33: RUF013 [*] PEP 484 prohibits implicit `Optional`
- airflow/providers/google/cloud/operators/pubsub.py:130:33: RUF013 [*] PEP 484 prohibits implicit `Optional`
- airflow/providers/google/common/utils/id_token_credentials.py:189:43: RUF013 [*] PEP 484 prohibits implicit `Optional`
- airflow/providers/jenkins/operators/jenkins_job_trigger.py:102:21: RUF013 [*] PEP 484 prohibits implicit `Optional`
- airflow/providers/jenkins/operators/jenkins_job_trigger.py:116:58: RUF013 [*] PEP 484 prohibits implicit `Optional` bokeh (+0, -3)
- src/bokeh/embed/standalone.py:158:52: RUF013 [*] PEP 484 prohibits implicit `Optional`
- src/bokeh/embed/standalone.py:300:22: RUF013 [*] PEP 484 prohibits implicit `Optional`
- src/bokeh/embed/standalone.py:371:62: RUF013 [*] PEP 484 prohibits implicit `Optional` disnake (+0, -30)
- disnake/app_commands.py:227:22: RUF013 [*] PEP 484 prohibits implicit `Optional`
- disnake/app_commands.py:354:22: RUF013 [*] PEP 484 prohibits implicit `Optional`
- disnake/app_commands.py:850:22: RUF013 [*] PEP 484 prohibits implicit `Optional`
- disnake/ext/commands/ctx_menus_core.py:177:15: RUF013 [*] PEP 484 prohibits implicit `Optional`
- disnake/ext/commands/ctx_menus_core.py:233:11: RUF013 [*] PEP 484 prohibits implicit `Optional`
- disnake/ext/commands/ctx_menus_core.py:312:11: RUF013 [*] PEP 484 prohibits implicit `Optional`
- disnake/ext/commands/ctx_menus_core.py:75:15: RUF013 [*] PEP 484 prohibits implicit `Optional`
- disnake/ext/commands/interaction_bot_base.py:487:15: RUF013 [*] PEP 484 prohibits implicit `Optional`
- disnake/ext/commands/interaction_bot_base.py:488:22: RUF013 [*] PEP 484 prohibits implicit `Optional`
- disnake/ext/commands/interaction_bot_base.py:581:15: RUF013 [*] PEP 484 prohibits implicit `Optional`
- disnake/ext/commands/interaction_bot_base.py:658:15: RUF013 [*] PEP 484 prohibits implicit `Optional`
- disnake/ext/commands/params.py:1128:11: RUF013 [*] PEP 484 prohibits implicit `Optional`
- disnake/ext/commands/params.py:1129:18: RUF013 [*] PEP 484 prohibits implicit `Optional`
- disnake/ext/commands/params.py:525:15: RUF013 [*] PEP 484 prohibits implicit `Optional`
- disnake/ext/commands/params.py:526:22: RUF013 [*] PEP 484 prohibits implicit `Optional`
- disnake/ext/commands/slash_core.py:144:15: RUF013 [*] PEP 484 prohibits implicit `Optional`
- disnake/ext/commands/slash_core.py:191:15: RUF013 [*] PEP 484 prohibits implicit `Optional`
- disnake/ext/commands/slash_core.py:192:22: RUF013 [*] PEP 484 prohibits implicit `Optional`
- disnake/ext/commands/slash_core.py:271:15: RUF013 [*] PEP 484 prohibits implicit `Optional`
- disnake/ext/commands/slash_core.py:272:22: RUF013 [*] PEP 484 prohibits implicit `Optional`
- disnake/ext/commands/slash_core.py:431:15: RUF013 [*] PEP 484 prohibits implicit `Optional`
- disnake/ext/commands/slash_core.py:432:22: RUF013 [*] PEP 484 prohibits implicit `Optional`
- disnake/ext/commands/slash_core.py:519:15: RUF013 [*] PEP 484 prohibits implicit `Optional`
- disnake/ext/commands/slash_core.py:520:22: RUF013 [*] PEP 484 prohibits implicit `Optional`
- disnake/ext/commands/slash_core.py:584:15: RUF013 [*] PEP 484 prohibits implicit `Optional`
- disnake/ext/commands/slash_core.py:747:11: RUF013 [*] PEP 484 prohibits implicit `Optional`
- disnake/ext/commands/slash_core.py:748:18: RUF013 [*] PEP 484 prohibits implicit `Optional`
- disnake/i18n.py:118:17: RUF013 [*] PEP 484 prohibits implicit `Optional`
- disnake/interactions/base.py:1856:85: RUF013 [*] PEP 484 prohibits implicit `Optional`
- disnake/utils.py:474:65: RUF013 [*] PEP 484 prohibits implicit `Optional` zulip (+0, -3)
- zerver/lib/db.py:34:43: RUF013 [*] PEP 484 prohibits implicit `Optional`
- zerver/views/auth.py:800:39: RUF013 [*] PEP 484 prohibits implicit `Optional`
- zerver/views/auth.py:927:42: RUF013 [*] PEP 484 prohibits implicit `Optional`
BenchmarkLinux
Windows
|
9caa5e9
to
d3ec468
Compare
[![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://beta.ruff.rs/docs) ([source](https://togithub.com/astral-sh/ruff), [changelog](https://togithub.com/astral-sh/ruff/releases)) | `^0.0.275` -> `^0.0.276` | [![age](https://badges.renovateapi.com/packages/pypi/ruff/0.0.276/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/ruff/0.0.276/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/ruff/0.0.276/compatibility-slim/0.0.275)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/ruff/0.0.276/confidence-slim/0.0.275)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>astral-sh/ruff (ruff)</summary> ### [`v0.0.276`](https://togithub.com/astral-sh/ruff/releases/tag/v0.0.276) [Compare Source](https://togithub.com/astral-sh/ruff/compare/v0.0.275...v0.0.276) <!-- Release notes generated using configuration in .github/release.yml at v0.0.276 --> See the [release blog post](https://astral.sh/blog/ruff-v0.0.276) for more, including detailed descriptions of any newly added rules. #### What's Changed Highlights include: experimental support for linting Jupyter Notebooks. To opt-in to linting Jupyter Notebook files, add the `*.ipynb` pattern to your [`include`](settings.md#include) setting, like so: ```toml [tool.ruff] ### Allow Ruff to discover `*.ipynb` files. include = ["*.py", "*.pyi", "**/pyproject.toml", "*.ipynb"] ``` This will prompt Ruff to discover Jupyter Notebook files in any specified directories, and lint them accordingly. Jupyter Notebook support is currently opt-in and experimental. We'd love your help testing it out. Have feedback? Run into issues? [Let us know!](https://togithub.com/astral-sh/ruff/issues/new) ##### New Rules - \[`flake8-pyi`] Implement `PYI002`, `PYI003`, `PYI004`, `PYI005` by [@​density](https://togithub.com/density) in [https://github.com/astral-sh/ruff/pull/5457](https://togithub.com/astral-sh/ruff/pull/5457) - \[`numpy`] Implement `numpy-deprecated-function` (`NPY003`) by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5468](https://togithub.com/astral-sh/ruff/pull/5468) - \[`perflint`] Implement `unnecessary-list-cast` (`PERF101`) by [@​qdegraaf](https://togithub.com/qdegraaf) in [https://github.com/astral-sh/ruff/pull/5121](https://togithub.com/astral-sh/ruff/pull/5121) - \[`perflint`] Implement `try-except-in-loop` (`PERF203`) by [@​evanrittenhouse](https://togithub.com/evanrittenhouse) in [https://github.com/astral-sh/ruff/pull/5166](https://togithub.com/astral-sh/ruff/pull/5166) - \[`perflint`] Implement `manual-list-comprehension` (`PERF401`) and `manual-list-copy` (`PERF402`) rules by [@​qdegraaf](https://togithub.com/qdegraaf) in [https://github.com/astral-sh/ruff/pull/5298](https://togithub.com/astral-sh/ruff/pull/5298) - \[`pylint`] Implement Pylint `single-string-used-for-slots` (`C0205`) as `single-string-slots` (`PLC0205`) by [@​tjkuson](https://togithub.com/tjkuson) in [https://github.com/astral-sh/ruff/pull/5399](https://togithub.com/astral-sh/ruff/pull/5399) ##### Jupyter - Experimental release for Jupyter notebook integration by [@​dhruvmanila](https://togithub.com/dhruvmanila) in [https://github.com/astral-sh/ruff/pull/5363](https://togithub.com/astral-sh/ruff/pull/5363) - Enable --watch for Jupyter notebooks by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5394](https://togithub.com/astral-sh/ruff/pull/5394) - Consider Jupyter index for code frames (`--show-source`) by [@​dhruvmanila](https://togithub.com/dhruvmanila) in [https://github.com/astral-sh/ruff/pull/5402](https://togithub.com/astral-sh/ruff/pull/5402) - fixup! Consider Jupyter index for code frames (`--show-source`) ([#​5402](https://togithub.com/astral-sh/ruff/issues/5402)) by [@​dhruvmanila](https://togithub.com/dhruvmanila) in [https://github.com/astral-sh/ruff/pull/5414](https://togithub.com/astral-sh/ruff/pull/5414) ##### Settings - \[`pyupgrade`] Restore the `keep-runtime-typing` setting by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5470](https://togithub.com/astral-sh/ruff/pull/5470) - Add `PythonVersion::Py312` by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5316](https://togithub.com/astral-sh/ruff/pull/5316) ##### Bug Fixes - Support `pydantic.BaseSettings` in `mutable-class-default` by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5312](https://togithub.com/astral-sh/ruff/pull/5312) - Allow `__slots__` assignments in `mutable-class-default` by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5314](https://togithub.com/astral-sh/ruff/pull/5314) - Avoid syntax errors when removing f-string prefixes by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5319](https://togithub.com/astral-sh/ruff/pull/5319) - Ignore unpacking in `iteration-over-set` by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5392](https://togithub.com/astral-sh/ruff/pull/5392) - Replace same length equal line with dash line in D407 by [@​dhruvmanila](https://togithub.com/dhruvmanila) in [https://github.com/astral-sh/ruff/pull/5383](https://togithub.com/astral-sh/ruff/pull/5383) - Exclude docstrings from PYI053 by [@​intgr](https://togithub.com/intgr) in [https://github.com/astral-sh/ruff/pull/5405](https://togithub.com/astral-sh/ruff/pull/5405) - Use "manual" fixability for E731 in shadowed context by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5430](https://togithub.com/astral-sh/ruff/pull/5430) - Detect consecutive, non-newline-delimited NumPy sections by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5467](https://togithub.com/astral-sh/ruff/pull/5467) - Fix `unnecessary-encode-utf8` to fix `encode` on parenthesized strings correctly by [@​harupy](https://togithub.com/harupy) in [https://github.com/astral-sh/ruff/pull/5478](https://togithub.com/astral-sh/ruff/pull/5478) - Allow `Final` assignments in stubs by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5490](https://togithub.com/astral-sh/ruff/pull/5490) - Respect `abc` decorators when classifying function types by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5315](https://togithub.com/astral-sh/ruff/pull/5315) - Allow `@Author` format for "Missing Author" rule in `flake8-todos` by [@​mayrholu](https://togithub.com/mayrholu) in [https://github.com/astral-sh/ruff/pull/4903](https://togithub.com/astral-sh/ruff/pull/4903) - Ignore type aliases for RUF013 by [@​dhruvmanila](https://togithub.com/dhruvmanila) in [https://github.com/astral-sh/ruff/pull/5344](https://togithub.com/astral-sh/ruff/pull/5344) - Change W605 autofix to use raw strings if possible by [@​hauntsaninja](https://togithub.com/hauntsaninja) in [https://github.com/astral-sh/ruff/pull/5352](https://togithub.com/astral-sh/ruff/pull/5352) - Add space when migrating to raw string by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5358](https://togithub.com/astral-sh/ruff/pull/5358) - Update the `invalid-escape-sequence` rule by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5359](https://togithub.com/astral-sh/ruff/pull/5359) - Include BaseException in B017 rule by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5466](https://togithub.com/astral-sh/ruff/pull/5466) - \[`flake8-django`] Skip duplicate violations in `DJ012` by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5469](https://togithub.com/astral-sh/ruff/pull/5469) #### New Contributors - [@​mayrholu](https://togithub.com/mayrholu) made their first contribution in [https://github.com/astral-sh/ruff/pull/4903](https://togithub.com/astral-sh/ruff/pull/4903) - [@​hauntsaninja](https://togithub.com/hauntsaninja) made their first contribution in [https://github.com/astral-sh/ruff/pull/5352](https://togithub.com/astral-sh/ruff/pull/5352) - [@​ethunk](https://togithub.com/ethunk) made their first contribution in [https://github.com/astral-sh/ruff/pull/5397](https://togithub.com/astral-sh/ruff/pull/5397) - [@​LouisDISPA](https://togithub.com/LouisDISPA) made their first contribution in [https://github.com/astral-sh/ruff/pull/5475](https://togithub.com/astral-sh/ruff/pull/5475) **Full Changelog**: astral-sh/ruff@v0.0.275...v0.0.276 </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://developer.mend.io/github/ixm-one/pytest-cmake-presets). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4xNDQuMiIsInVwZGF0ZWRJblZlciI6IjM1LjE0NC4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9--> 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://beta.ruff.rs/docs) ([source](https://togithub.com/astral-sh/ruff), [changelog](https://togithub.com/astral-sh/ruff/releases)) | `0.0.275` -> `0.0.276` | [![age](https://badges.renovateapi.com/packages/pypi/ruff/0.0.276/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/ruff/0.0.276/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/ruff/0.0.276/compatibility-slim/0.0.275)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/ruff/0.0.276/confidence-slim/0.0.275)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>astral-sh/ruff (ruff)</summary> ### [`v0.0.276`](https://togithub.com/astral-sh/ruff/releases/tag/v0.0.276) [Compare Source](https://togithub.com/astral-sh/ruff/compare/v0.0.275...v0.0.276) <!-- Release notes generated using configuration in .github/release.yml at v0.0.276 --> See the [release blog post](https://astral.sh/blog/ruff-v0.0.276) for more, including detailed descriptions of any newly added rules. #### What's Changed Highlights include: experimental support for linting Jupyter Notebooks. To opt-in to linting Jupyter Notebook files, add the `*.ipynb` pattern to your [`include`](settings.md#include) setting, like so: ```toml [tool.ruff] ### Allow Ruff to discover `*.ipynb` files. include = ["*.py", "*.pyi", "**/pyproject.toml", "*.ipynb"] ``` This will prompt Ruff to discover Jupyter Notebook files in any specified directories, and lint them accordingly. Jupyter Notebook support is currently opt-in and experimental. We'd love your help testing it out. Have feedback? Run into issues? [Let us know!](https://togithub.com/astral-sh/ruff/issues/new) ##### New Rules - \[`flake8-pyi`] Implement `PYI002`, `PYI003`, `PYI004`, `PYI005` by [@​density](https://togithub.com/density) in [https://github.com/astral-sh/ruff/pull/5457](https://togithub.com/astral-sh/ruff/pull/5457) - \[`numpy`] Implement `numpy-deprecated-function` (`NPY003`) by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5468](https://togithub.com/astral-sh/ruff/pull/5468) - \[`perflint`] Implement `unnecessary-list-cast` (`PERF101`) by [@​qdegraaf](https://togithub.com/qdegraaf) in [https://github.com/astral-sh/ruff/pull/5121](https://togithub.com/astral-sh/ruff/pull/5121) - \[`perflint`] Implement `try-except-in-loop` (`PERF203`) by [@​evanrittenhouse](https://togithub.com/evanrittenhouse) in [https://github.com/astral-sh/ruff/pull/5166](https://togithub.com/astral-sh/ruff/pull/5166) - \[`perflint`] Implement `manual-list-comprehension` (`PERF401`) and `manual-list-copy` (`PERF402`) rules by [@​qdegraaf](https://togithub.com/qdegraaf) in [https://github.com/astral-sh/ruff/pull/5298](https://togithub.com/astral-sh/ruff/pull/5298) - \[`pylint`] Implement Pylint `single-string-used-for-slots` (`C0205`) as `single-string-slots` (`PLC0205`) by [@​tjkuson](https://togithub.com/tjkuson) in [https://github.com/astral-sh/ruff/pull/5399](https://togithub.com/astral-sh/ruff/pull/5399) ##### Jupyter - Experimental release for Jupyter notebook integration by [@​dhruvmanila](https://togithub.com/dhruvmanila) in [https://github.com/astral-sh/ruff/pull/5363](https://togithub.com/astral-sh/ruff/pull/5363) - Enable --watch for Jupyter notebooks by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5394](https://togithub.com/astral-sh/ruff/pull/5394) - Consider Jupyter index for code frames (`--show-source`) by [@​dhruvmanila](https://togithub.com/dhruvmanila) in [https://github.com/astral-sh/ruff/pull/5402](https://togithub.com/astral-sh/ruff/pull/5402) - fixup! Consider Jupyter index for code frames (`--show-source`) ([#​5402](https://togithub.com/astral-sh/ruff/issues/5402)) by [@​dhruvmanila](https://togithub.com/dhruvmanila) in [https://github.com/astral-sh/ruff/pull/5414](https://togithub.com/astral-sh/ruff/pull/5414) ##### Settings - \[`pyupgrade`] Restore the `keep-runtime-typing` setting by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5470](https://togithub.com/astral-sh/ruff/pull/5470) - Add `PythonVersion::Py312` by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5316](https://togithub.com/astral-sh/ruff/pull/5316) ##### Bug Fixes - Support `pydantic.BaseSettings` in `mutable-class-default` by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5312](https://togithub.com/astral-sh/ruff/pull/5312) - Allow `__slots__` assignments in `mutable-class-default` by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5314](https://togithub.com/astral-sh/ruff/pull/5314) - Avoid syntax errors when removing f-string prefixes by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5319](https://togithub.com/astral-sh/ruff/pull/5319) - Ignore unpacking in `iteration-over-set` by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5392](https://togithub.com/astral-sh/ruff/pull/5392) - Replace same length equal line with dash line in D407 by [@​dhruvmanila](https://togithub.com/dhruvmanila) in [https://github.com/astral-sh/ruff/pull/5383](https://togithub.com/astral-sh/ruff/pull/5383) - Exclude docstrings from PYI053 by [@​intgr](https://togithub.com/intgr) in [https://github.com/astral-sh/ruff/pull/5405](https://togithub.com/astral-sh/ruff/pull/5405) - Use "manual" fixability for E731 in shadowed context by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5430](https://togithub.com/astral-sh/ruff/pull/5430) - Detect consecutive, non-newline-delimited NumPy sections by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5467](https://togithub.com/astral-sh/ruff/pull/5467) - Fix `unnecessary-encode-utf8` to fix `encode` on parenthesized strings correctly by [@​harupy](https://togithub.com/harupy) in [https://github.com/astral-sh/ruff/pull/5478](https://togithub.com/astral-sh/ruff/pull/5478) - Allow `Final` assignments in stubs by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5490](https://togithub.com/astral-sh/ruff/pull/5490) - Respect `abc` decorators when classifying function types by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5315](https://togithub.com/astral-sh/ruff/pull/5315) - Allow `@Author` format for "Missing Author" rule in `flake8-todos` by [@​mayrholu](https://togithub.com/mayrholu) in [https://github.com/astral-sh/ruff/pull/4903](https://togithub.com/astral-sh/ruff/pull/4903) - Ignore type aliases for RUF013 by [@​dhruvmanila](https://togithub.com/dhruvmanila) in [https://github.com/astral-sh/ruff/pull/5344](https://togithub.com/astral-sh/ruff/pull/5344) - Change W605 autofix to use raw strings if possible by [@​hauntsaninja](https://togithub.com/hauntsaninja) in [https://github.com/astral-sh/ruff/pull/5352](https://togithub.com/astral-sh/ruff/pull/5352) - Add space when migrating to raw string by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5358](https://togithub.com/astral-sh/ruff/pull/5358) - Update the `invalid-escape-sequence` rule by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5359](https://togithub.com/astral-sh/ruff/pull/5359) - Include BaseException in B017 rule by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5466](https://togithub.com/astral-sh/ruff/pull/5466) - \[`flake8-django`] Skip duplicate violations in `DJ012` by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5469](https://togithub.com/astral-sh/ruff/pull/5469) #### New Contributors - [@​mayrholu](https://togithub.com/mayrholu) made their first contribution in [https://github.com/astral-sh/ruff/pull/4903](https://togithub.com/astral-sh/ruff/pull/4903) - [@​hauntsaninja](https://togithub.com/hauntsaninja) made their first contribution in [https://github.com/astral-sh/ruff/pull/5352](https://togithub.com/astral-sh/ruff/pull/5352) - [@​ethunk](https://togithub.com/ethunk) made their first contribution in [https://github.com/astral-sh/ruff/pull/5397](https://togithub.com/astral-sh/ruff/pull/5397) - [@​LouisDISPA](https://togithub.com/LouisDISPA) made their first contribution in [https://github.com/astral-sh/ruff/pull/5475](https://togithub.com/astral-sh/ruff/pull/5475) **Full Changelog**: astral-sh/ruff@v0.0.275...v0.0.276 </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://developer.mend.io/github/jankatins/pr-workflow-example). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4xNDQuMiIsInVwZGF0ZWRJblZlciI6IjM1LjE0NC4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->
[![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://beta.ruff.rs/docs) ([source](https://togithub.com/astral-sh/ruff), [changelog](https://togithub.com/astral-sh/ruff/releases)) | `==0.0.275` -> `==0.0.277` | [![age](https://badges.renovateapi.com/packages/pypi/ruff/0.0.277/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/ruff/0.0.277/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/ruff/0.0.277/compatibility-slim/0.0.275)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/ruff/0.0.277/confidence-slim/0.0.275)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>astral-sh/ruff (ruff)</summary> ### [`v0.0.277`](https://togithub.com/astral-sh/ruff/compare/v0.0.276...v0.0.277) [Compare Source](https://togithub.com/astral-sh/ruff/compare/v0.0.276...v0.0.277) ### [`v0.0.276`](https://togithub.com/astral-sh/ruff/releases/tag/v0.0.276) [Compare Source](https://togithub.com/astral-sh/ruff/compare/v0.0.275...v0.0.276) <!-- Release notes generated using configuration in .github/release.yml at v0.0.276 --> See the [release blog post](https://astral.sh/blog/ruff-v0.0.276) for more, including detailed descriptions of any newly added rules. #### What's Changed Highlights include: experimental support for linting Jupyter Notebooks. To opt-in to linting Jupyter Notebook files, add the `*.ipynb` pattern to your [`include`](settings.md#include) setting, like so: ```toml [tool.ruff] ### Allow Ruff to discover `*.ipynb` files. include = ["*.py", "*.pyi", "**/pyproject.toml", "*.ipynb"] ``` This will prompt Ruff to discover Jupyter Notebook files in any specified directories, and lint them accordingly. Jupyter Notebook support is currently opt-in and experimental. We'd love your help testing it out. Have feedback? Run into issues? [Let us know!](https://togithub.com/astral-sh/ruff/issues/new) ##### New Rules - \[`flake8-pyi`] Implement `PYI002`, `PYI003`, `PYI004`, `PYI005` by [@​density](https://togithub.com/density) in [https://github.com/astral-sh/ruff/pull/5457](https://togithub.com/astral-sh/ruff/pull/5457) - \[`numpy`] Implement `numpy-deprecated-function` (`NPY003`) by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5468](https://togithub.com/astral-sh/ruff/pull/5468) - \[`perflint`] Implement `unnecessary-list-cast` (`PERF101`) by [@​qdegraaf](https://togithub.com/qdegraaf) in [https://github.com/astral-sh/ruff/pull/5121](https://togithub.com/astral-sh/ruff/pull/5121) - \[`perflint`] Implement `try-except-in-loop` (`PERF203`) by [@​evanrittenhouse](https://togithub.com/evanrittenhouse) in [https://github.com/astral-sh/ruff/pull/5166](https://togithub.com/astral-sh/ruff/pull/5166) - \[`perflint`] Implement `manual-list-comprehension` (`PERF401`) and `manual-list-copy` (`PERF402`) rules by [@​qdegraaf](https://togithub.com/qdegraaf) in [https://github.com/astral-sh/ruff/pull/5298](https://togithub.com/astral-sh/ruff/pull/5298) - \[`pylint`] Implement Pylint `single-string-used-for-slots` (`C0205`) as `single-string-slots` (`PLC0205`) by [@​tjkuson](https://togithub.com/tjkuson) in [https://github.com/astral-sh/ruff/pull/5399](https://togithub.com/astral-sh/ruff/pull/5399) ##### Jupyter - Experimental release for Jupyter notebook integration by [@​dhruvmanila](https://togithub.com/dhruvmanila) in [https://github.com/astral-sh/ruff/pull/5363](https://togithub.com/astral-sh/ruff/pull/5363) - Enable --watch for Jupyter notebooks by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5394](https://togithub.com/astral-sh/ruff/pull/5394) - Consider Jupyter index for code frames (`--show-source`) by [@​dhruvmanila](https://togithub.com/dhruvmanila) in [https://github.com/astral-sh/ruff/pull/5402](https://togithub.com/astral-sh/ruff/pull/5402) - fixup! Consider Jupyter index for code frames (`--show-source`) ([#​5402](https://togithub.com/astral-sh/ruff/issues/5402)) by [@​dhruvmanila](https://togithub.com/dhruvmanila) in [https://github.com/astral-sh/ruff/pull/5414](https://togithub.com/astral-sh/ruff/pull/5414) ##### Settings - \[`pyupgrade`] Restore the `keep-runtime-typing` setting by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5470](https://togithub.com/astral-sh/ruff/pull/5470) - Add `PythonVersion::Py312` by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5316](https://togithub.com/astral-sh/ruff/pull/5316) ##### Bug Fixes - Support `pydantic.BaseSettings` in `mutable-class-default` by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5312](https://togithub.com/astral-sh/ruff/pull/5312) - Allow `__slots__` assignments in `mutable-class-default` by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5314](https://togithub.com/astral-sh/ruff/pull/5314) - Avoid syntax errors when removing f-string prefixes by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5319](https://togithub.com/astral-sh/ruff/pull/5319) - Ignore unpacking in `iteration-over-set` by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5392](https://togithub.com/astral-sh/ruff/pull/5392) - Replace same length equal line with dash line in D407 by [@​dhruvmanila](https://togithub.com/dhruvmanila) in [https://github.com/astral-sh/ruff/pull/5383](https://togithub.com/astral-sh/ruff/pull/5383) - Exclude docstrings from PYI053 by [@​intgr](https://togithub.com/intgr) in [https://github.com/astral-sh/ruff/pull/5405](https://togithub.com/astral-sh/ruff/pull/5405) - Use "manual" fixability for E731 in shadowed context by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5430](https://togithub.com/astral-sh/ruff/pull/5430) - Detect consecutive, non-newline-delimited NumPy sections by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5467](https://togithub.com/astral-sh/ruff/pull/5467) - Fix `unnecessary-encode-utf8` to fix `encode` on parenthesized strings correctly by [@​harupy](https://togithub.com/harupy) in [https://github.com/astral-sh/ruff/pull/5478](https://togithub.com/astral-sh/ruff/pull/5478) - Allow `Final` assignments in stubs by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5490](https://togithub.com/astral-sh/ruff/pull/5490) - Respect `abc` decorators when classifying function types by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5315](https://togithub.com/astral-sh/ruff/pull/5315) - Allow `@Author` format for "Missing Author" rule in `flake8-todos` by [@​mayrholu](https://togithub.com/mayrholu) in [https://github.com/astral-sh/ruff/pull/4903](https://togithub.com/astral-sh/ruff/pull/4903) - Ignore type aliases for RUF013 by [@​dhruvmanila](https://togithub.com/dhruvmanila) in [https://github.com/astral-sh/ruff/pull/5344](https://togithub.com/astral-sh/ruff/pull/5344) - Change W605 autofix to use raw strings if possible by [@​hauntsaninja](https://togithub.com/hauntsaninja) in [https://github.com/astral-sh/ruff/pull/5352](https://togithub.com/astral-sh/ruff/pull/5352) - Add space when migrating to raw string by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5358](https://togithub.com/astral-sh/ruff/pull/5358) - Update the `invalid-escape-sequence` rule by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5359](https://togithub.com/astral-sh/ruff/pull/5359) - Include BaseException in B017 rule by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5466](https://togithub.com/astral-sh/ruff/pull/5466) - \[`flake8-django`] Skip duplicate violations in `DJ012` by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5469](https://togithub.com/astral-sh/ruff/pull/5469) #### New Contributors - [@​mayrholu](https://togithub.com/mayrholu) made their first contribution in [https://github.com/astral-sh/ruff/pull/4903](https://togithub.com/astral-sh/ruff/pull/4903) - [@​hauntsaninja](https://togithub.com/hauntsaninja) made their first contribution in [https://github.com/astral-sh/ruff/pull/5352](https://togithub.com/astral-sh/ruff/pull/5352) - [@​ethunk](https://togithub.com/ethunk) made their first contribution in [https://github.com/astral-sh/ruff/pull/5397](https://togithub.com/astral-sh/ruff/pull/5397) - [@​LouisDISPA](https://togithub.com/LouisDISPA) made their first contribution in [https://github.com/astral-sh/ruff/pull/5475](https://togithub.com/astral-sh/ruff/pull/5475) **Full Changelog**: astral-sh/ruff@v0.0.275...v0.0.276 </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://developer.mend.io/github/allenporter/pyrainbird). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4xNDQuMiIsInVwZGF0ZWRJblZlciI6IjM1LjE0NC4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9--> 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://beta.ruff.rs/docs) ([source](https://togithub.com/astral-sh/ruff), [changelog](https://togithub.com/astral-sh/ruff/releases)) | `==0.0.275` -> `==0.0.278` | [![age](https://badges.renovateapi.com/packages/pypi/ruff/0.0.278/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/ruff/0.0.278/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/ruff/0.0.278/compatibility-slim/0.0.275)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/ruff/0.0.278/confidence-slim/0.0.275)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>astral-sh/ruff (ruff)</summary> ### [`v0.0.278`](https://togithub.com/astral-sh/ruff/releases/tag/v0.0.278) [Compare Source](https://togithub.com/astral-sh/ruff/compare/v0.0.277...v0.0.278) <!-- Release notes generated using configuration in .github/release.yml at main --> See the [release blog post](https://astral.sh/blog/ruff-v0.0.278) for more, including detailed descriptions of any newly added rules. #### What's Changed ##### Rules - \[`pylint`] Implement `typevar-bivariance` (`PLC0131`) by [@​tjkuson](https://togithub.com/tjkuson) in [https://github.com/astral-sh/ruff/pull/5517](https://togithub.com/astral-sh/ruff/pull/5517) - \[`flake8-pyi`] Implement `unnecessary-literal-union` (`PYI030`) by [@​zanieb](https://togithub.com/zanieb) in [https://github.com/astral-sh/ruff/pull/5570](https://togithub.com/astral-sh/ruff/pull/5570) - \[`pylint`] Implement `type-name-incorrect-variance` (`PLC0105`) by [@​tjkuson](https://togithub.com/tjkuson) in [https://github.com/astral-sh/ruff/pull/5651](https://togithub.com/astral-sh/ruff/pull/5651) - \[`ruff`] Implement `unnecessary-list-allocation-for-first-element` (`RUF015`) by [@​evanrittenhouse](https://togithub.com/evanrittenhouse) in [https://github.com/astral-sh/ruff/pull/5549](https://togithub.com/astral-sh/ruff/pull/5549) - \[`flake8-bugbear`] Implement `re-sub-positional-args` (`B034`) by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5669](https://togithub.com/astral-sh/ruff/pull/5669) - \[`ruff`] Implement `invalid-index-type` (`RUF016`) by [@​zanieb](https://togithub.com/zanieb) in [https://github.com/astral-sh/ruff/pull/5602](https://togithub.com/astral-sh/ruff/pull/5602) ##### Settings - \[`isort`] Add `--case-sensitive` flag by [@​qdegraaf](https://togithub.com/qdegraaf) in [https://github.com/astral-sh/ruff/pull/5539](https://togithub.com/astral-sh/ruff/pull/5539) - \[`isort`] Support globbing in `isort` options by [@​tjkuson](https://togithub.com/tjkuson) in [https://github.com/astral-sh/ruff/pull/5473](https://togithub.com/astral-sh/ruff/pull/5473) ##### Bug Fixes - Support autofix for some multiline `str.format` calls by [@​harupy](https://togithub.com/harupy) in [https://github.com/astral-sh/ruff/pull/5638](https://togithub.com/astral-sh/ruff/pull/5638) - Avoid triggering `unnecessary-map` (`C417`) for late-bound lambdas by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5520](https://togithub.com/astral-sh/ruff/pull/5520) - Avoid triggering DTZ001-006 when using `.astimezone()` by [@​dhruvmanila](https://togithub.com/dhruvmanila) in [https://github.com/astral-sh/ruff/pull/5524](https://togithub.com/astral-sh/ruff/pull/5524) - Enable attribute lookups via semantic model by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5536](https://togithub.com/astral-sh/ruff/pull/5536) - Avoid syntax errors when rewriting str(dict) in f-strings by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5538](https://togithub.com/astral-sh/ruff/pull/5538) - Differentiate between runtime and typing-time annotations by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5575](https://togithub.com/astral-sh/ruff/pull/5575) - Only run pyproject.toml lint rules when enabled by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5578](https://togithub.com/astral-sh/ruff/pull/5578) - Refactor isort directive skips to use iterators by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5623](https://togithub.com/astral-sh/ruff/pull/5623) - Allow descriptor instantiations in dataclass fields by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5537](https://togithub.com/astral-sh/ruff/pull/5537) - Refactor `noqa` directive parsing away from regex-based implementation by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5554](https://togithub.com/astral-sh/ruff/pull/5554) - Emit warnings for invalid `# noqa` directives by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5571](https://togithub.com/astral-sh/ruff/pull/5571) - Support individual codes on `# flake8: noqa` directives by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5618](https://togithub.com/astral-sh/ruff/pull/5618) - Add `tkinter` import convention by [@​tjkuson](https://togithub.com/tjkuson) in [https://github.com/astral-sh/ruff/pull/5626](https://togithub.com/astral-sh/ruff/pull/5626) - Avoid `PERF401` if conditional depends on list var by [@​dhruvmanila](https://togithub.com/dhruvmanila) in [https://github.com/astral-sh/ruff/pull/5603](https://togithub.com/astral-sh/ruff/pull/5603) - Fix typo in complex-if-statement-in-stub message by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5635](https://togithub.com/astral-sh/ruff/pull/5635) - Make TRY301 trigger only if a `raise` throws a caught exception by [@​evanrittenhouse](https://togithub.com/evanrittenhouse) in [https://github.com/astral-sh/ruff/pull/5455](https://togithub.com/astral-sh/ruff/pull/5455) - Skip flake8-future-annotations checks in stub files by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5652](https://togithub.com/astral-sh/ruff/pull/5652) - Always allow PEP 585 and PEP 604 rewrites in stub files by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5653](https://togithub.com/astral-sh/ruff/pull/5653) - Add support for `Union` declarations without `|` to PYI016 by [@​zanieb](https://togithub.com/zanieb) in [https://github.com/astral-sh/ruff/pull/5598](https://togithub.com/astral-sh/ruff/pull/5598) - Ignore `_name_` and `_value_` accesses in `flake8-self` rules by [@​monosans](https://togithub.com/monosans) in [https://github.com/astral-sh/ruff/pull/5663](https://togithub.com/astral-sh/ruff/pull/5663) - Refactor `repeated_keys()` to use `ComparableExpr` by [@​qdegraaf](https://togithub.com/qdegraaf) in [https://github.com/astral-sh/ruff/pull/5696](https://togithub.com/astral-sh/ruff/pull/5696) #### New Contributors - [@​karosis88](https://togithub.com/karosis88) made their first contribution in [https://github.com/astral-sh/ruff/pull/5560](https://togithub.com/astral-sh/ruff/pull/5560) - [@​petermattia](https://togithub.com/petermattia) made their first contribution in [https://github.com/astral-sh/ruff/pull/5579](https://togithub.com/astral-sh/ruff/pull/5579) - [@​DimitriPapadopoulos](https://togithub.com/DimitriPapadopoulos) made their first contribution in [https://github.com/astral-sh/ruff/pull/5607](https://togithub.com/astral-sh/ruff/pull/5607) **Full Changelog**: astral-sh/ruff@v0.0.277...v0.0.278 ### [`v0.0.277`](https://togithub.com/astral-sh/ruff/releases/tag/v0.0.277) [Compare Source](https://togithub.com/astral-sh/ruff/compare/v0.0.276...v0.0.277) <!-- Release notes generated using configuration in .github/release.yml at v0.0.277 --> #### What's Changed ##### Breaking Changes - Add .ipynb_checkpoints, .pyenv, .pytest_cache, and .vscode to default excludes by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5513](https://togithub.com/astral-sh/ruff/pull/5513) ##### Rules - \[`pylint`] Implement Pylint `typevar-name-mismatch` (`C0132`) by [@​tjkuson](https://togithub.com/tjkuson) in [https://github.com/astral-sh/ruff/pull/5501](https://togithub.com/astral-sh/ruff/pull/5501) ##### Settings - Add `ruff rule --all` subcommand (with JSON output) by [@​akx](https://togithub.com/akx) in [https://github.com/astral-sh/ruff/pull/5059](https://togithub.com/astral-sh/ruff/pull/5059) ##### Bug Fixes - Fix eval detection for suspicious-eval-usage by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5506](https://togithub.com/astral-sh/ruff/pull/5506) - Avoid PERF rules for iteration-dependent assignments by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5508](https://togithub.com/astral-sh/ruff/pull/5508) - Avoid returning first-match for rule prefixes by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5511](https://togithub.com/astral-sh/ruff/pull/5511) **Full Changelog**: astral-sh/ruff@v0.0.276...v0.0.277 ### [`v0.0.276`](https://togithub.com/astral-sh/ruff/releases/tag/v0.0.276) [Compare Source](https://togithub.com/astral-sh/ruff/compare/v0.0.275...v0.0.276) <!-- Release notes generated using configuration in .github/release.yml at v0.0.276 --> See the [release blog post](https://astral.sh/blog/ruff-v0.0.276) for more, including detailed descriptions of any newly added rules. #### What's Changed Highlights include: experimental support for linting Jupyter Notebooks. To opt-in to linting Jupyter Notebook files, add the `*.ipynb` pattern to your [`include`](settings.md#include) setting, like so: ```toml [tool.ruff] ### Allow Ruff to discover `*.ipynb` files. include = ["*.py", "*.pyi", "**/pyproject.toml", "*.ipynb"] ``` This will prompt Ruff to discover Jupyter Notebook files in any specified directories, and lint them accordingly. Jupyter Notebook support is currently opt-in and experimental. We'd love your help testing it out. Have feedback? Run into issues? [Let us know!](https://togithub.com/astral-sh/ruff/issues/new) ##### New Rules - \[`flake8-pyi`] Implement `PYI002`, `PYI003`, `PYI004`, `PYI005` by [@​density](https://togithub.com/density) in [https://github.com/astral-sh/ruff/pull/5457](https://togithub.com/astral-sh/ruff/pull/5457) - \[`numpy`] Implement `numpy-deprecated-function` (`NPY003`) by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5468](https://togithub.com/astral-sh/ruff/pull/5468) - \[`perflint`] Implement `unnecessary-list-cast` (`PERF101`) by [@​qdegraaf](https://togithub.com/qdegraaf) in [https://github.com/astral-sh/ruff/pull/5121](https://togithub.com/astral-sh/ruff/pull/5121) - \[`perflint`] Implement `try-except-in-loop` (`PERF203`) by [@​evanrittenhouse](https://togithub.com/evanrittenhouse) in [https://github.com/astral-sh/ruff/pull/5166](https://togithub.com/astral-sh/ruff/pull/5166) - \[`perflint`] Implement `manual-list-comprehension` (`PERF401`) and `manual-list-copy` (`PERF402`) rules by [@​qdegraaf](https://togithub.com/qdegraaf) in [https://github.com/astral-sh/ruff/pull/5298](https://togithub.com/astral-sh/ruff/pull/5298) - \[`pylint`] Implement Pylint `single-string-used-for-slots` (`C0205`) as `single-string-slots` (`PLC0205`) by [@​tjkuson](https://togithub.com/tjkuson) in [https://github.com/astral-sh/ruff/pull/5399](https://togithub.com/astral-sh/ruff/pull/5399) ##### Jupyter - Experimental release for Jupyter notebook integration by [@​dhruvmanila](https://togithub.com/dhruvmanila) in [https://github.com/astral-sh/ruff/pull/5363](https://togithub.com/astral-sh/ruff/pull/5363) - Enable --watch for Jupyter notebooks by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5394](https://togithub.com/astral-sh/ruff/pull/5394) - Consider Jupyter index for code frames (`--show-source`) by [@​dhruvmanila](https://togithub.com/dhruvmanila) in [https://github.com/astral-sh/ruff/pull/5402](https://togithub.com/astral-sh/ruff/pull/5402) - fixup! Consider Jupyter index for code frames (`--show-source`) ([#​5402](https://togithub.com/astral-sh/ruff/issues/5402)) by [@​dhruvmanila](https://togithub.com/dhruvmanila) in [https://github.com/astral-sh/ruff/pull/5414](https://togithub.com/astral-sh/ruff/pull/5414) ##### Settings - \[`pyupgrade`] Restore the `keep-runtime-typing` setting by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5470](https://togithub.com/astral-sh/ruff/pull/5470) - Add `PythonVersion::Py312` by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5316](https://togithub.com/astral-sh/ruff/pull/5316) ##### Bug Fixes - Support `pydantic.BaseSettings` in `mutable-class-default` by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5312](https://togithub.com/astral-sh/ruff/pull/5312) - Allow `__slots__` assignments in `mutable-class-default` by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5314](https://togithub.com/astral-sh/ruff/pull/5314) - Avoid syntax errors when removing f-string prefixes by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5319](https://togithub.com/astral-sh/ruff/pull/5319) - Ignore unpacking in `iteration-over-set` by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5392](https://togithub.com/astral-sh/ruff/pull/5392) - Replace same length equal line with dash line in D407 by [@​dhruvmanila](https://togithub.com/dhruvmanila) in [https://github.com/astral-sh/ruff/pull/5383](https://togithub.com/astral-sh/ruff/pull/5383) - Exclude docstrings from PYI053 by [@​intgr](https://togithub.com/intgr) in [https://github.com/astral-sh/ruff/pull/5405](https://togithub.com/astral-sh/ruff/pull/5405) - Use "manual" fixability for E731 in shadowed context by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5430](https://togithub.com/astral-sh/ruff/pull/5430) - Detect consecutive, non-newline-delimited NumPy sections by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5467](https://togithub.com/astral-sh/ruff/pull/5467) - Fix `unnecessary-encode-utf8` to fix `encode` on parenthesized strings correctly by [@​harupy](https://togithub.com/harupy) in [https://github.com/astral-sh/ruff/pull/5478](https://togithub.com/astral-sh/ruff/pull/5478) - Allow `Final` assignments in stubs by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5490](https://togithub.com/astral-sh/ruff/pull/5490) - Respect `abc` decorators when classifying function types by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5315](https://togithub.com/astral-sh/ruff/pull/5315) - Allow `@Author` format for "Missing Author" rule in `flake8-todos` by [@​mayrholu](https://togithub.com/mayrholu) in [https://github.com/astral-sh/ruff/pull/4903](https://togithub.com/astral-sh/ruff/pull/4903) - Ignore type aliases for RUF013 by [@​dhruvmanila](https://togithub.com/dhruvmanila) in [https://github.com/astral-sh/ruff/pull/5344](https://togithub.com/astral-sh/ruff/pull/5344) - Change W605 autofix to use raw strings if possible by [@​hauntsaninja](https://togithub.com/hauntsaninja) in [https://github.com/astral-sh/ruff/pull/5352](https://togithub.com/astral-sh/ruff/pull/5352) - Add space when migrating to raw string by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5358](https://togithub.com/astral-sh/ruff/pull/5358) - Update the `invalid-escape-sequence` rule by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5359](https://togithub.com/astral-sh/ruff/pull/5359) - Include BaseException in B017 rule by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5466](https://togithub.com/astral-sh/ruff/pull/5466) - \[`flake8-django`] Skip duplicate violations in `DJ012` by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5469](https://togithub.com/astral-sh/ruff/pull/5469) #### New Contributors - [@​mayrholu](https://togithub.com/mayrholu) made their first contribution in [https://github.com/astral-sh/ruff/pull/4903](https://togithub.com/astral-sh/ruff/pull/4903) - [@​hauntsaninja](https://togithub.com/hauntsaninja) made their first contribution in [https://github.com/astral-sh/ruff/pull/5352](https://togithub.com/astral-sh/ruff/pull/5352) - [@​ethunk](https://togithub.com/ethunk) made their first contribution in [https://github.com/astral-sh/ruff/pull/5397](https://togithub.com/astral-sh/ruff/pull/5397) - [@​LouisDISPA](https://togithub.com/LouisDISPA) made their first contribution in [https://github.com/astral-sh/ruff/pull/5475](https://togithub.com/astral-sh/ruff/pull/5475) **Full Changelog**: astral-sh/ruff@v0.0.275...v0.0.276 </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://developer.mend.io/github/allenporter/flux-local). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4xNTkuNyIsInVwZGF0ZWRJblZlciI6IjM2LjUuMyIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Summary
Ignore type aliases for RUF013 to avoid flagging false positives:
But, at the expense of having false negatives:
Test Plan
cargo test
fixes: #5295