The keep-runtime-typing setting has been reinstated (#5470)
The keep-runtime-typing setting has been reinstated with revised semantics. This setting was
removed in #4427, as it was equivalent to ignoring
the UP006 and UP007 rules via Ruff's standard ignore mechanism.
Taking UP006 (rewrite List[int] to list[int]) as an example, the setting now behaves as
follows:
On Python 3.7 and Python 3.8, setting keep-runtime-typing = true will cause Ruff to ignore
UP006 violations, even if from __future__ import annotations is present in the file.
While such annotations are valid in Python 3.7 and Python 3.8 when combined with
from __future__ import annotations, they aren't supported by libraries like Pydantic and
FastAPI, which rely on runtime type checking.
On Python 3.9 and above, the setting has no effect, as list[int] is a valid type annotation,
and libraries like Pydantic and FastAPI support it without issue.
In short: keep-runtime-typing can be used to ensure that Ruff doesn't introduce type annotations
that are not supported at runtime by the current Python version, which are unsupported by libraries
like Pydantic and FastAPI.
Note that this is not a breaking change, but is included here to complement the previous removal
of keep-runtime-typing.
0.0.268
The keep-runtime-typing setting has been removed (#4427)
Enabling the keep-runtime-typing option, located under the pyupgrade section, is equivalent
to ignoring the UP006 and UP007 rules via Ruff's standard ignore mechanism. As there's no
need for a dedicated setting to disable these rules, the keep-runtime-typing option has been
removed.
0.0.267
update-check is no longer a valid configuration option (#4313)
The update-check functionality was deprecated in #2530,
in that the behavior itself was removed, and Ruff was changed to warn when that option was enabled.
Now, Ruff will throw an error when update-check is provided via a configuration file (e.g.,
update-check = false) or through the command-line, since it has no effect. Users should remove
this option from their configuration.
0.0.265
--fix-only now exits with a zero exit code, unless --exit-non-zero-on-fix is specified (#4146)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Bumps ruff from 0.0.264 to 0.0.276.
Release notes
Sourced from ruff's releases.
... (truncated)
Changelog
Sourced from ruff's changelog.
... (truncated)
Commits
3992c47
Bump version to 0.0.276 (#5488)8de5a3d
AllowFinal
assignments in stubs (#5490)ed1dd09
Refine someperflint
rules (#5484)ca497fa
Remove somediagnostics.extend
calls (#5483)00fbbe4
Remove some additional manual iterator matches (#5482)dadad0e
Remove some allocations in argument detection (#5481)d2450c2
Auditremove_argument
usages to use end-of-function (#5480)1e4b889
Fixunnecessary-encode-utf8
to fixencode
on parenthesized strings correc...dc07253
Fix python_formatter generate.py with rust path (#5475)7ac9e02
Document Checking formatter stability and panics (#5415)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)