24 KiB
Changelog 0.8.x
0.8.0
Check out the blog post for a migration guide and overview of the changes!
Breaking changes
See also, the "Remapped rules" section which may result in disabled rules.
-
Default to Python 3.9
Ruff now defaults to Python 3.9 instead of 3.8 if no explicit Python version is configured using
ruff.target-versionorproject.requires-python(#13896) -
Changed location of
pydoclintdiagnosticspydoclintdiagnostics now point to the first-line of the problematic docstring. Previously, this was not the case.If you've opted into these preview rules but have them suppressed using
noqacomments in some places, this change may mean that you need to move thenoqasuppression comments. Most users should be unaffected by this change. -
Use XDG (i.e.
~/.local/bin) instead of the Cargo home directory in the standalone installerPreviously, Ruff's installer used
$CARGO_HOMEor~/.cargo/binfor its target install directory. Now, Ruff will be installed into$XDG_BIN_HOME,$XDG_DATA_HOME/../bin, or~/.local/bin(in that order).This change is only relevant to users of the standalone Ruff installer (using the shell or PowerShell script). If you installed Ruff using uv or pip, you should be unaffected.
-
Changes to the line width calculation
Ruff now uses a new version of the unicode-width Rust crate to calculate the line width. In very rare cases, this may lead to lines containing Unicode characters being reformatted, or being considered too long when they were not before (
E501).
Removed Rules
The following deprecated rules have been removed:
missing-type-self(ANN101)missing-type-cls(ANN102)syntax-error(E999)pytest-missing-fixture-name-underscore(PT004)pytest-incorrect-fixture-name-underscore(PT005)unpacked-list-comprehension(UP027)
Remapped rules
The following rules have been remapped to new rule codes:
flake8-type-checking:TCHtoTC
Stabilization
The following rules have been stabilized and are no longer in preview:
builtin-import-shadowing(A004)mutable-contextvar-default(B039)fast-api-redundant-response-model(FAST001)fast-api-non-annotated-dependency(FAST002)dict-index-missing-items(PLC0206)pep484-style-positional-only-parameter(PYI063)redundant-final-literal(PYI064)bad-version-info-order(PYI066)parenthesize-chained-operators(RUF021)unsorted-dunder-all(RUF022)unsorted-dunder-slots(RUF023)assert-with-print-message(RUF030)unnecessary-default-type-args(UP043)
The following behaviors have been stabilized:
ambiguous-variable-name(E741): Violations in stub files are now ignored. Stub authors typically don't control variable names.printf-string-formatting(UP031): Report allprintf-like usages even if no autofix is available
The following fixes have been stabilized:
zip-instead-of-pairwise(RUF007)
Preview features
-
`flake8-datetimez` -
`flake8-pie` -
`flake8-pyi` -
`flake8-pyi` -
`ruff` -
`ruff` -
`ruff` -
`pycodestyle` -
`pylint`
Rule changes
invalid-pyproject-toml(RUF200): Updated to reflect the provisionally accepted PEP 639.-
`flake8-pyi` -
`flake8-type-checking` -
`pylint`
Configuration
- Ruff now emits a warning instead of an error when a configuration
ignores a rule that has been removed (#14435) - Ruff now validates that
lint.flake8-import-conventions.aliasesonly uses valid module names and aliases (#14477)
0.8.1
Preview features
- Formatter: Avoid invalid syntax for format-spec with quotes for all Python versions (#14625)
- Formatter: Consider quotes inside format-specs when choosing the quotes for an f-string (#14493)
- Formatter: Do not consider f-strings with escaped newlines as multiline (#14624)
- Formatter: Fix f-string formatting in assignment statement (#14454)
- Formatter: Fix unnecessary space around power operator (
**) in overlong f-string expressions (#14489) -
`airflow` -
`flake8-builtins` -
`flake8-pytest-style` -
`flake8-type-checking` -
`flake8-type-checking` -
`flake8-use-pathlib` -
`pylint` -
`pylint` -
`refurb` -
`ruff` -
`ruff` -
`ruff` -
`ruff`
Rule changes
- Ignore more rules for stub files (#14541)
-
`pep8-naming` -
`pyflakes` -
`ruff` -
`ruff`
Bug fixes
- Avoid fixing code to
None | Noneforredundant-none-literal(PYI061) andnever-union(RUF020) (#14583, #14589) -
`flake8-bugbear` -
`flake8-pyi`, `ruff` -
`flake8-pyi` -
`flake8-type-checking` -
`pylint` -
`ruff`
0.8.2
Preview features
-
`airflow` -
`airflow` -
`ruff` -
`ruff` -
`ruff`
Rule changes
-
`airflow` -
`flake8-pytest-style` -
`pandas-vet` -
`pylint` -
`refurb`
Configuration
-
`flake8-import-conventions`
Bug fixes
- Revert: [pyflakes] Avoid false positives in
@no_type_checkcontexts (F821,F722) (#14615) (#14726) -
`pep8-naming` -
`pycodestyle` -
`pylint` -
`refurb` -
`ruff`
Documentation
- Improve docs for
flake8-use-pathlibrules (#14741) - Improve error messages and docs for
flake8-comprehensionsrules (#14729) -
`flake8-type-checking`
0.8.3
Preview features
- Fix fstring formatting removing overlong implicit concatenated string in expression part (#14811)
-
`airflow` -
`airflow` -
`flake8-bugbear` -
`flake8-bugbear` -
`flake8-use-pathlib` -
`pylint` -
`ruff` -
`ruff` -
`ruff` -
`ruff` -
`ruff`
Rule changes
-
`flake8-bugbear` -
`flake8-pyi` -
`pyupgrade` -
`pyupgrade`
Bug fixes
- Raise syntax error for mixing
exceptandexcept*(#14895) -
`flake8-bugbear` -
`flake8-bugbear` -
`flake8-comprehensions` -
`flake8-pyi` -
`flake8-pytest-style` -
`perflint` -
`pylint`
0.8.4
Preview features
-
`airflow` -
`airflow` -
`flake8-use-pathlib` -
`perflint` -
`perflint` -
`pylint` -
`ruff` -
`ruff`
Rule changes
-
`flake8-bandit` -
`flake8-pyi` -
`pydocstyle` -
`ruff`
Bug
-
`perflint`
Server
- Check diagnostic refresh support from client capability which enables dynamic configuration for various editors (#15014)
0.8.5
Preview features
-
`airflow` -
`airflow` -
`fastapi` -
`flake8-type-checking` -
`pylint` -
`ruff` -
`ruff` -
`ruff`
Rule changes
- Visit PEP 764 inline
TypedDictkeys as non-type-expressions (#15073) -
`flake8-comprehensions` -
`flake8-pie` -
`flake8-simplify` -
`flake8-use-pathlib` -
`pycodestyle` -
`pydocstyle` -
`pyupgrade`
Configuration
-
`flake8-type-checking` -
`pydocstyle` -
`ruff`
Bug fixes
- Fix type subscript on older python versions (#15090)
- Use
TypeCheckerfor detectingfastapiroutes (#15093) -
`pycodestyle`
Documentation
- Fix incorrect doc in
shebang-not-executable(EXE001) and add git+windows solution to executable bit (#15208) - Rename rules currently not conforming to naming convention (#15102)
0.8.6
Preview features
-
`format` -
`ruff` -
`ruff`
Rule changes
-
`flake8-todos` -
`pyflakes`
CLI
- Show errors for attempted fixes only when passed
--verbose(#15237)
Bug fixes
-
`ruff` -
`pyupgrade`