15 KiB
Changelog
0.13.3
Released on 2025-10-02.
Preview features
- Display diffs for
ruff format --check
and add support for different output formats (#20443) - [
pyflakes
] Handle some common submodule import situations forunused-import
(F401
) (#20200) - [
ruff
] Do not flag%r
+repr()
combinations (RUF065
) (#20600)
Bug fixes
- [
cli
] Add conflict between--add-noqa
and--diff
options (#20642) - [
pylint
] Exempt required imports fromPLR0402
(#20381) - [
pylint
] Fix missingmax-nested-blocks
in settings display (#20574) - [
pyupgrade
] Prevent infinite loop withI002
andUP026
(#20634)
Rule changes
- [
flake8-simplify
] Improve help message clarity (SIM105
) (#20548)
Documentation
- Add the The Basics title back to CONTRIBUTING.md (#20624)
- Fixed documentation for try_consider_else (#20587)
- [
isort
] Clarify dependency betweenorder-by-type
andcase-sensitive
settings (#20559) - [
pylint
] Clarify fix safety to include left-hand hashability (PLR6201
) (#20518)
Other changes
- [
playground
] Fix quick fixes for empty ranges in playground (#20599)
Contributors
0.13.2
Released on 2025-09-25.
Preview features
- [
flake8-async
] Implementblocking-path-method
(ASYNC240
) (#20264) - [
flake8-bugbear
] Implementmap-without-explicit-strict
(B912
) (#20429) - [
flake8-bultins
] Detect class-scope builtin shadowing in decorators, default args, and attribute initializers (A003
) (#20178) - [
ruff
] Implementlogging-eager-conversion
(RUF065
) (#19942) - Include
.pyw
files by default when linting and formatting (#20458)
Bug fixes
- Deduplicate input paths (#20105)
- [
flake8-comprehensions
] Preserve trailing commas for single-element lists (C409
) (#19571) - [
flake8-pyi
] Avoid syntax error from conflict withPIE790
(PYI021
) (#20010) - [
flake8-simplify
] Correct fix for positivemaxsplit
without separator (SIM905
) (#20056) - [
pyupgrade
] FixUP008
not to apply when__class__
is a local variable (#20497) - [
ruff
] FixB004
to skip invalidhasattr
/getattr
calls (#20486) - [
ruff
] Replace-nan
withnan
when using the value to construct aDecimal
(FURB164
) (#20391)
Documentation
- Add 'Finding ways to help' to CONTRIBUTING.md (#20567)
- Update import path to
ruff-wasm-web
(#20539) - [
flake8-bandit
] Clarify the supported hashing functions (S324
) (#20534)
Other changes
- [
playground
] Allow hover quick fixes to appear for overlapping diagnostics (#20527) - [
playground
] Fix non‑BMP code point handling in quick fixes and markers (#20526)
Contributors
- @BurntSushi
- @mtshiba
- @second-ed
- @danparizher
- @ShikChen
- @PieterCK
- @GDYendell
- @RazerM
- @TaKO8Ki
- @amyreese
- @ntbre
- @MichaReiser
0.13.1
Released on 2025-09-18.
Preview features
- [
flake8-simplify
] Detect unnecessaryNone
default for additional key expression types (SIM910
) (#20343) - [
flake8-use-pathlib
] Add fix forPTH123
(#20169) - [
flake8-use-pathlib
] FixPTH101
,PTH104
,PTH105
,PTH121
fixes (#20143) - [
flake8-use-pathlib
] MakePTH111
fix unsafe because it can change behavior (#20215) - [
pycodestyle
] FixE301
to only trigger for functions immediately within a class (#19768) - [
refurb
] Marksingle-item-membership-test
fix as always unsafe (FURB171
) (#20279)
Bug fixes
- Handle t-strings for token-based rules and suppression comments (#20357)
- [
flake8-bandit
] Fix truthiness: dict-only**
displays not truthy forshell
(S602
,S604
,S609
) (#20177) - [
flake8-simplify
] Fix diagnostic to show correct method name forstr.rsplit
calls (SIM905
) (#20459) - [
flynt
] Use triple quotes for joined raw strings with newlines (FLY002
) (#20197) - [
pyupgrade
] Fix false positive when class name is shadowed by local variable (UP008
) (#20427) - [
pyupgrade
] Prevent infinite loop withI002
andUP026
(#20327) - [
ruff
] Recognize t-strings, generators, and lambdas ininvalid-index-type
(RUF016
) (#20213)
Rule changes
- [
RUF102
] Respect rule redirects in invalid rule code detection (#20245) - [
flake8-bugbear
] Mark the fix forunreliable-callable-check
as always unsafe (B004
) (#20318) - [
ruff
] Allow dataclass attribute value instantiation from nested frozen dataclass (RUF009
) (#20352)
CLI
- Add fixes to
output-format=sarif
(#20300) - Treat panics as fatal diagnostics, sort panics last (#20258)
Documentation
- [
ruff
] Addanalyze.string-imports-min-dots
to settings (#20375) - Update README.md with Albumentations new repository URL (#20415)
Other changes
Contributors
- @chirizxc
- @danparizher
- @IDrokin117
- @amyreese
- @AlexWaygood
- @dylwil3
- @njhearp
- @woodruffw
- @dcreager
- @TaKO8Ki
- @BurntSushi
- @salahelfarissi
- @MichaReiser
0.13.0
Check out the blog post for a migration guide and overview of the changes!
Breaking changes
-
Several rules can now add
from __future__ import annotations
automaticallyTC001
,TC002
,TC003
,RUF013
, andUP037
now addfrom __future__ import annotations
as part of their fixes when thelint.future-annotations
setting is enabled. This allows the rules to move more imports intoTYPE_CHECKING
blocks (TC001
,TC002
, andTC003
), use PEP 604 union syntax on Python versions before 3.10 (RUF013
), and unquote more annotations (UP037
). -
Full module paths are now used to verify first-party modules
Ruff now checks that the full path to a module exists on disk before categorizing it as a first-party import. This change makes first-party import detection more accurate, helping to avoid false positives on local directories with the same name as a third-party dependency, for example. See the FAQ section on import categorization for more details.
-
Deprecated rules must now be selected by exact rule code
Ruff will no longer activate deprecated rules selected by their group name or prefix. As noted below, the two remaining deprecated rules were also removed in this release, so this won't affect any current rules, but it will still affect any deprecations in the future.
-
The deprecated macOS configuration directory fallback has been removed
Ruff will no longer look for a user-level configuration file at
~/Library/Application Support/ruff/ruff.toml
on macOS. This feature was deprecated in v0.5 in favor of using the XDG specification (usually resolving to~/.config/ruff/ruff.toml
), like on Linux. The fallback and accompanying deprecation warning have now been removed.
Removed Rules
The following rules have been removed:
pandas-df-variable-name
(PD901
)non-pep604-isinstance
(UP038
)
Stabilization
The following rules have been stabilized and are no longer in preview:
airflow-dag-no-schedule-argument
(AIR002
)airflow3-removal
(AIR301
)airflow3-moved-to-provider
(AIR302
)airflow3-suggested-update
(AIR311
)airflow3-suggested-to-move-to-provider
(AIR312
)long-sleep-not-forever
(ASYNC116
)f-string-number-format
(FURB116
)os-symlink
(PTH211
)generic-not-last-base-class
(PYI059
)redundant-none-literal
(PYI061
)pytest-raises-ambiguous-pattern
(RUF043
)unused-unpacked-variable
(RUF059
)useless-class-metaclass-type
(UP050
)
The following behaviors have been stabilized:
assert-raises-exception
(B017
) now checks for direct calls tounittest.TestCase.assert_raises
andpytest.raises
instead of only the context manager forms.missing-trailing-comma
(COM812
) andprohibited-trailing-comma
(COM819
) now check for trailing commas in PEP 695 type parameter lists.raw-string-in-exception
(EM101
) now also checks for byte strings in exception messages.invalid-mock-access
(PGH005
) now checks forAsyncMock
methods likenot_awaited
in addition to the synchronous variants.useless-import-alias
(PLC0414
) no longer applies to__init__.py
files, where it conflicted with one of the suggested fixes forunused-import
(F401
).bidirectional-unicode
(PLE2502
) now also checks for U+061C (Arabic Letter Mark).- The fix for
multiple-with-statements
(SIM117
) is now marked as always safe.
Preview features
- [
pyupgrade
] EnableUP043
in stub files (#20027)
Bug fixes
- [
pyupgrade
] ApplyUP008
only when the__class__
cell exists (#19424) - [
ruff
] Fix empty f-string detection inin-empty-collection
(RUF060
) (#20249)
Server
- Add support for using uv as an alternative formatter backend (#19665)
Documentation
- [
pep8-naming
] Fix formatting of__all__
(N816
) (#20301)
0.12.x
0.11.x
0.10.x
0.9.x
See changelogs/0.9.x
0.8.x
See changelogs/0.8.x
0.7.x
See changelogs/0.7.x
0.6.x
See changelogs/0.6.x
0.5.x
See changelogs/0.5.x
0.4.x
See changelogs/0.4.x
0.3.x
See changelogs/0.3.x
0.2.x
See changelogs/0.2.x
0.1.x
See changelogs/0.1.x