Update dependency ruff to ^0.12.0
This MR contains the following updates:
Package | Change | Age | Confidence |
---|---|---|---|
ruff (source, changelog) |
^0.4.2 -> ^0.12.0
|
Release Notes
astral-sh/ruff (ruff)
v0.12.5
Preview features
- [
flake8-use-pathlib
] Add autofix forPTH101
,PTH104
,PTH105
,PTH121
(#19404) - [
ruff
] Support byte strings (RUF055
) (#18926)
Bug fixes
- Fix
unreachable
panic in parser (#19183) - [
flake8-pyi
] Skip fix if allUnion
members areNone
(PYI016
) (#19416) - [
perflint
] Parenthesize generator expressions (PERF401
) (#19325) - [
pylint
] Handle empty comments after line continuation (PLR2044
) (#19405)
Rule changes
- [
pep8-naming
] FixN802
false positives forCGIHTTPRequestHandler
andSimpleHTTPRequestHandler
(#19432)
v0.12.4
Preview features
- [
flake8-type-checking
,pyupgrade
,ruff
] Addfrom __future__ import annotations
when it would allow new fixes (TC001
,TC002
,TC003
,UP037
,RUF013
) (#19100) - [
flake8-use-pathlib
] Add autofix forPTH109
(#19245) - [
pylint
] Detect indirectpathlib.Path
usages forunspecified-encoding
(PLW1514
) (#19304)
Bug fixes
- [
flake8-bugbear
] FixB017
false negatives for keyword exception arguments (#19217) - [
flake8-use-pathlib
] Fix false negative on directPath()
instantiation (PTH210
) (#19388) - [
flake8-django
] FixDJ008
false positive for abstract models with type-annotatedabstract
field (#19221) - [
isort
] FixI002
import insertion after docstring with multiple string statements (#19222) - [
isort
] Treat form feed as valid whitespace before a semicolon (#19343) - [
pydoclint
] FixSyntaxError
from fixes with line continuations (D201
,D202
) (#19246) - [
refurb
]FURB164
fix should validate arguments and should usually be marked unsafe (#19136)
Rule changes
- [
flake8-use-pathlib
] Skip single dots forinvalid-pathlib-with-suffix
(PTH210
) on versions >= 3.14 (#19331) - [
pep8_naming
] Avoid false positives on standard library functions with uppercase names (N802
) (#18907) - [
pycodestyle
] Handle brace escapes for t-strings in logical lines (#19358) - [
pylint
] Extend invalid string character rules to include t-strings (#19355) - [
ruff
] Allowstrict
kwarg when checking forstarmap-zip
(RUF058
) in Python 3.14+ (#19333)
Documentation
- [
flake8-type-checking
] MakeTC010
docs example more realistic (#19356) - Make more documentation examples error out-of-the-box (#19288,#19272,#19291,#19296,#19292,#19295,#19297,#19309)
v0.12.3
Preview features
- [
flake8-bugbear
] Support non-context-manager calls inB017
(#19063) - [
flake8-use-pathlib
] Add autofixes forPTH100
,PTH106
,PTH107
,PTH108
,PTH110
,PTH111
,PTH112
,PTH113
,PTH114
,PTH115
,PTH117
,PTH119
,PTH120
(#19213) - [
flake8-use-pathlib
] Add autofixes forPTH203
,PTH204
,PTH205
(#18922)
Bug fixes
- [
flake8-return
] Fix false-positive for variables used inside nested functions inRET504
(#18433) - Treat form feed as valid whitespace before a line continuation (#19220)
- [
flake8-type-checking
] Fix syntax error introduced by fix (TC008
) (#19150) - [
pyupgrade
] Keyword arguments insuper
should suppress theUP008
fix (#19131)
Documentation
- [
flake8-pyi
] Make example error out-of-the-box (PYI007
,PYI008
) (#19103) - [
flake8-simplify
] Make example error out-of-the-box (SIM116
) (#19111) - [
flake8-type-checking
] Make example error out-of-the-box (TC001
) (#19151) - [
flake8-use-pathlib
] Make example error out-of-the-box (PTH210
) (#19189) - [
pycodestyle
] Make example error out-of-the-box (E272
) (#19191) - [
pycodestyle
] Make example not raise unnecessarySyntaxError
(E114
) (#19190) - [
pydoclint
] Make example error out-of-the-box (DOC501
) (#19218) - [
pylint
,pyupgrade
] Fix syntax errors in examples (PLW1501
,UP028
) (#19127) - [
pylint
] Updatemissing-maxsplit-arg
docs and error to suggest proper usage (PLC0207
) (#18949) - [
flake8-bandit
] Make example error out-of-the-box (S412
) (#19241)
v0.12.2
Preview features
- [
flake8-pyi
] ExpandOptional[A]
toA | None
(PYI016
) (#18572) - [
pyupgrade
] MarkUP008
fix safe if no comments are in range (#18683)
Bug fixes
- [
flake8-comprehensions
] FixC420
to prepend whitespace when needed (#18616) - [
perflint
] FixPERF403
panic on attribute or subscription loop variable (#19042) - [
pydocstyle
] FixD413
infinite loop for parenthesized docstring (#18930) - [
pylint
] FixPLW0108
autofix introducing a syntax error when the lambda's body contains an assignment expression (#18678) - [
refurb
] Fix false positive on empty tuples (FURB168
) (#19058) - [
ruff
] Allow morefield
calls fromattrs
(RUF009
) (#19021) - [
ruff
] Fix syntax error introduced for an empty string followed by a u-prefixed string (UP025
) (#18899)
Rule changes
- [
flake8-executable
] Allowuvx
in shebang line (EXE003
) (#18967) - [
pandas
] Avoid flaggingPD002
ifpandas
is not imported (#18963) - [
pyupgrade
] Avoid PEP-604 unions withtyping.NamedTuple
(UP007
,UP045
) (#18682)
Documentation
- Document link between
import-outside-top-level (PLC0415)
andlint.flake8-tidy-imports.banned-module-level-imports
(#18733) - Fix description of the
format.skip-magic-trailing-comma
example (#19095) - [
airflow
] MakeAIR302
example error out-of-the-box (#18988) - [
airflow
] MakeAIR312
example error out-of-the-box (#18989) - [
flake8-annotations
] MakeANN401
example error out-of-the-box (#18974) - [
flake8-async
] MakeASYNC100
example error out-of-the-box (#18993) - [
flake8-async
] MakeASYNC105
example error out-of-the-box (#19002) - [
flake8-async
] MakeASYNC110
example error out-of-the-box (#18975) - [
flake8-async
] MakeASYNC210
example error out-of-the-box (#18977) - [
flake8-async
] MakeASYNC220
,ASYNC221
, andASYNC222
examples error out-of-the-box (#18978) - [
flake8-async
] MakeASYNC251
example error out-of-the-box (#18990) - [
flake8-bandit
] MakeS201
example error out-of-the-box (#19017) - [
flake8-bandit
] MakeS604
andS609
examples error out-of-the-box (#19049) - [
flake8-bugbear
] MakeB028
example error out-of-the-box (#19054) - [
flake8-bugbear
] MakeB911
example error out-of-the-box (#19051) - [
flake8-datetimez
] MakeDTZ011
example error out-of-the-box (#19055) - [
flake8-datetimez
] MakeDTZ901
example error out-of-the-box (#19056) - [
flake8-pyi
] MakePYI032
example error out-of-the-box (#19061) - [
flake8-pyi
] Make example error out-of-the-box (PYI014
,PYI015
) (#19097) - [
flake8-pyi
] Make example error out-of-the-box (PYI042
) (#19101) - [
flake8-pyi
] Make example error out-of-the-box (PYI059
) (#19080) - [
flake8-pyi
] Make example error out-of-the-box (PYI062
) (#19079) - [
flake8-pytest-style
] Make example error out-of-the-box (PT023
) (#19104) - [
flake8-pytest-style
] Make example error out-of-the-box (PT030
) (#19105) - [
flake8-quotes
] Make example error out-of-the-box (Q003
) (#19106) - [
flake8-simplify
] Make example error out-of-the-box (SIM110
) (#19113) - [
flake8-simplify
] Make example error out-of-the-box (SIM113
) (#19109) - [
flake8-simplify
] Make example error out-of-the-box (SIM401
) (#19110) - [
pyflakes
] Fix backslash in docs (F621
) (#19098) - [
pylint
] FixPLC0415
example (#18970)
v0.12.1
Preview features
- [
flake8-errmsg
] ExtendEM101
to support byte strings (#18867) - [
flake8-use-pathlib
] Add autofix forPTH202
(#18763) - [
pygrep-hooks
] AddAsyncMock
methods toinvalid-mock-access
(PGH005
) (#18547) - [
pylint
] Ignore__init__.py
files in (PLC0414
) (#18400) - [
ruff
] TriggerRUF037
for empty string and byte strings (#18862) - [formatter] Fix missing blank lines before decorated classes in
.pyi
files (#18888)
Bug fixes
- Avoid generating diagnostics with per-file ignores (#18801)
- Handle parenthesized arguments in
remove_argument
(#18805) - [
flake8-logging
] Avoid false positive forexc_info=True
outsidelogger.exception
(LOG014
) (#18737) - [
flake8-pytest-style
] Enforcepytest
import for decorators (#18779) - [
flake8-pytest-style
] Mark autofix forPT001
andPT023
as unsafe if there's comments in the decorator (#18792) - [
flake8-pytest-style
]PT001
/PT023
fix makes syntax error on parenthesized decorator (#18782) - [
flake8-raise
] Make fix unsafe if it deletes comments (RSE102
) (#18788) - [
flake8-simplify
] FixSIM911
autofix creating a syntax error (#18793) - [
flake8-simplify
] Fix false negatives for shadowed bindings (SIM910
,SIM911
) (#18794) - [
flake8-simplify
] Preserve original behavior forexcept ()
and bareexcept
(SIM105
) (#18213) - [
flake8-pyi
] FixPYI041
's fix causingTypeError
withNone | None | ...
(#18637) - [
perflint
] FixPERF101
autofix creating a syntax error and mark autofix as unsafe if there are comments in thelist
call expr (#18803) - [
perflint
] Fix false negative inPERF401
(#18866) - [
pylint
] Avoid flattening nestedmin
/max
when outer call has single argument (PLW3301
) (#16885) - [
pylint
] FixPLC2801
autofix creating a syntax error (#18857) - [
pylint
] MarkPLE0241
autofix as unsafe if there's comments in the base classes (#18832) - [
pylint
] SuppressPLE2510
/PLE2512
/PLE2513
/PLE2514
/PLE2515
autofix if the text contains an odd number of backslashes (#18856) - [
refurb
] Detect more exotic float literals inFURB164
(#18925) - [
refurb
] FixFURB163
autofix creating a syntax error foryield
expressions (#18756) - [
refurb
] MarkFURB129
autofix as unsafe if there's comments in thereadlines
call (#18858) - [
ruff
] Fix false positives and negatives inRUF010
(#18690) - Fix casing of
analyze.direction
variant names (#18892)
Rule changes
- Fix f-string interpolation escaping in generated fixes (#18882)
- [
flake8-return
] MarkRET501
fix unsafe if comments are inside (#18780) - [
flake8-async
] Fix detection for large integer sleep durations inASYNC116
rule (#18767) - [
flake8-async
] Mark autofix forASYNC115
as unsafe if the call expression contains comments (#18753) - [
flake8-bugbear
] Mark autofix forB004
as unsafe if thehasattr
call expr contains comments (#18755) - [
flake8-comprehension
] Mark autofix forC420
as unsafe if there's comments inside the dict comprehension (#18768) - [
flake8-comprehensions
] Handle template strings for comprehension fixes (#18710) - [
flake8-future-annotations
] Add autofix (FA100
) (#18903) - [
pyflakes
] MarkF504
/F522
/F523
autofix as unsafe if there's a call with side effect (#18839) - [
pylint
] Allow fix with comments and document performance implications (PLW3301
) (#18936) - [
pylint
] Detect more exoticNaN
literals inPLW0177
(#18630) - [
pylint
] FixPLC1802
autofix creating a syntax error and mark autofix as unsafe if there's comments in thelen
call (#18836) - [
pyupgrade
] Extend version detection to includesys.version_info.major
(UP036
) (#18633) - [
ruff
] Add lint ruleRUF064
for callingchmod
with non-octal integers (#18541) - [
ruff
] Addedcls.__dict__.get('__annotations__')
check (RUF063
) (#18233) - [
ruff
] Frozendataclass
default should be valid (RUF009
) (#18735)
Server
- Consider virtual path for various server actions (#18910)
Documentation
- Add fix safety sections (#18940,#18841,#18802,#18837,#18800,#18415,#18853,#18842)
- Use updated pre-commit id (#18718)
- [
perflint
] Small docs improvement toPERF401
(#18786) - [
pyupgrade
]: Usesuper()
, not__super__
in error messages (UP008
) (#18743) - [
flake8-pie
] Small docs fix toPIE794
(#18829) - [
flake8-pyi
] Correctcollections-named-tuple
example to use PascalCase assignment (#16884) - [
flake8-pie
] Add note on type checking benefits tounnecessary-dict-kwargs
(PIE804
) (#18666) - [
pycodestyle
] Clarify PEP 8 relationship towhitespace-around-operator
rules (#18870)
Other changes
- Disallow newlines in format specifiers of single quoted f- or t-strings (#18708)
- [
flake8-logging
] Add fix safety section toLOG002
(#18840) - [
pyupgrade
] Add fix safety section toUP010
(#18838)
v0.12.0
Check out the blog post for a migration guide and overview of the changes!
Breaking changes
-
Detection of more syntax errors
Ruff now detects version-related syntax errors, such as the use of the
match
statement on Python versions before 3.10, and syntax errors emitted by CPython's compiler, such as irrefutablematch
patterns before the finalcase
arm. -
New default Python version handling for syntax errors
Ruff will default to the latest supported Python version (3.13) when checking for the version-related syntax errors mentioned above to prevent false positives in projects without a Python version configured. The default in all other cases, like applying lint rules, is unchanged and remains at the minimum supported Python version (3.9).
-
Updated f-string formatting
Ruff now formats multi-line f-strings with format specifiers to avoid adding a line break after the format specifier. This addresses a change to the Python grammar in version 3.13.4 that made such a line break a syntax error.
-
rust-toolchain.toml
is no longer included in source distributionsThe
rust-toolchain.toml
is used to specify a higher Rust version than Ruff's minimum supported Rust version (MSRV) for development and building release artifacts. However, when present in source distributions, it would also cause downstream package maintainers to pull in the same Rust toolchain, even if their available toolchain was MSRV-compatible.
Removed Rules
The following rules have been removed:
-
suspicious-xmle-tree-usage
(S320
)
Deprecated Rules
The following rules have been deprecated:
Stabilization
The following rules have been stabilized and are no longer in preview:
-
for-loop-writes
(FURB122
) -
check-and-remove-from-set
(FURB132
) -
verbose-decimal-constructor
(FURB157
) -
fromisoformat-replace-z
(FURB162
) -
int-on-sliced-str
(FURB166
) -
exc-info-outside-except-handler
(LOG014
) -
import-outside-top-level
(PLC0415
) -
unnecessary-dict-index-lookup
(PLR1733
) -
nan-comparison
(PLW0177
) -
eq-without-hash
(PLW1641
) -
pytest-parameter-with-default-argument
(PT028
) -
pytest-warns-too-broad
(PT030
) -
pytest-warns-with-multiple-statements
(PT031
) -
invalid-formatter-suppression-comment
(RUF028
) -
dataclass-enum
(RUF049
) -
class-with-mixed-type-vars
(RUF053
) -
unnecessary-round
(RUF057
) -
starmap-zip
(RUF058
) - [
non-pep604-annotation-optional
] (UP045
) -
non-pep695-generic-class
(UP046
) -
non-pep695-generic-function
(UP047
) -
private-type-parameter
(UP049
)
The following behaviors have been stabilized:
- [
collection-literal-concatenation
] (RUF005
) now recognizes slices, in addition to list literals and variables. - The fix for [
readlines-in-for
] (FURB129
) is now marked as always safe. - [
if-else-block-instead-of-if-exp
] (SIM108
) will now further simplify expressions to useor
instead of anif
expression, where possible. - [
unused-noqa
] (RUF100
) now checks for file-levelnoqa
comments as well as inline comments. - [
subprocess-without-shell-equals-true
] (S603
) now accepts literal strings, as well as lists and tuples of literal strings, as trusted input. - [
boolean-type-hint-positional-argument
] (FBT001
) now applies to types that includebool
, likebool | int
ortyping.Optional[bool]
, in addition to plainbool
annotations. - [
non-pep604-annotation-union
] (UP007
) has now been split into two rules.UP007
now applies only totyping.Union
, while [non-pep604-annotation-optional
] (UP045
) checks for use oftyping.Optional
.UP045
has also been stabilized in this release, but you may need to update existinginclude
,ignore
, ornoqa
settings to accommodate this change.
Preview features
- [
ruff
] Check for non-context-manager use ofpytest.raises
,pytest.warns
, andpytest.deprecated_call
(RUF061
) (#17368) - [syntax-errors] Raise unsupported syntax error for template strings prior to Python 3.14 (#18664)
Bug fixes
- Add syntax error when conversion flag does not immediately follow exclamation mark (#18706)
- Add trailing space around
readlines
(#18542) - Fix
\r
and\r\n
handling in t- and f-string debug texts (#18673) - Hug closing
}
when f-string expression has a format specifier (#18704) - [
flake8-pyi
] Avoid syntax error in the case of starred and keyword arguments (PYI059
) (#18611) - [
flake8-return
] FixRET504
autofix generating a syntax error (#18428) - [
pep8-naming
] Suppress fix forN804
andN805
if the recommended name is already used (#18472) - [
pycodestyle
] Avoid causing a syntax error in expressions spanning multiple lines (E731
) (#18479) - [
pyupgrade
] SuppressUP008
ifsuper
is shadowed (#18688) - [
refurb
] Parenthesize lambda and ternary expressions (FURB122
,FURB142
) (#18592) - [
ruff
] Handle extra arguments todeque
(RUF037
) (#18614) - [
ruff
] Preserve parentheses arounddeque
in fix forunnecessary-empty-iterable-within-deque-call
(RUF037
) (#18598) - [
ruff
] Validate arguments before offering a fix (RUF056
) (#18631) - [
ruff
] Skip fix forRUF059
if dummy name is already bound (#18509) - [
pylint
] FixPLW0128
to check assignment targets in square brackets and after asterisks (#18665)
Rule changes
- Fix false positive on mutations in
return
statements (B909
) (#18408) - Treat
ty:
comments as pragma comments (#18532) - [
flake8-pyi
] Applycustom-typevar-for-self
to string annotations (PYI019
) (#18311) - [
pyupgrade
] Don't offer a fix forOptional[None]
(UP007
,UP045)
(#18545) - [
pyupgrade
] Fixsuper(__class__, self)
detection (UP008
) (#18478) - [
refurb
] Make the fix forFURB163
unsafe forlog2
,log10
,*args
, and deleted comments (#18645)
Server
- Support cancellation requests (#18627)
Documentation
- Drop confusing second
*
from glob pattern example forper-file-target-version
(#18709) - Update Neovim configuration examples (#18491)
- [
pylint
] De-emphasize__hash__ = Parent.__hash__
(PLW1641
) (#18613) - [
refurb
] Add a note about float literal handling (FURB157
) (#18615)
v0.11.13
Release Notes
Preview features
- [
airflow
] Add unsafe fix for module moved cases (AIR301
,AIR311
,AIR312
,AIR302
) (#18367,#18366,#18363,#18093) - [
refurb
] Add coverage ofset
andfrozenset
calls (FURB171
) (#18035) - [
refurb
] MarkFURB180
fix unsafe when class has bases (#18149)
Bug fixes
- [
perflint
] Fix missing parentheses for lambda and ternary conditions (PERF401
,PERF403
) (#18412) - [
pyupgrade
] ApplyUP035
only on py313+ forget_type_hints()
(#18476) - [
pyupgrade
] Make fix unsafe if it deletes comments (UP004
,UP050
) (#18393, #18390)
Rule changes
- [
fastapi
] Avoid false positive for class dependencies (FAST003
) (#18271)
Documentation
- Update editor setup docs for Neovim and Vim (#18324)
Other changes
- Support Python 3.14 template strings (t-strings) in formatter and parser (#17851)
Contributors
- @AlexWaygood
- @BurntSushi
- @InSyncWithFoo
- @Lee-W
- @MatthewMckee4
- @MichaReiser
- @Viicos
- @abhijeetbodas2001
- @carljm
- @chirizxc
- @dcreager
- @dhruvmanila
- @dylwil3
- @github-actions
- @ibraheemdev
- @lipefree
- @mtshiba
- @naslundx
- @ntBre
- @otakutyrant
- @renovate
- @robsdedude
- @sharkdp
- @twentyone212121
- @zanieb
Install ruff 0.11.13
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.11.13/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ruff/releases/download/0.11.13/ruff-installer.ps1 | iex"
Download ruff 0.11.13
v0.11.12
Release Notes
Preview features
- [
airflow
] Revise fix titles (AIR3
) (#18215) - [
pylint
] Implementmissing-maxsplit-arg
(PLC0207
) (#17454) - [
pyupgrade
] New ruleUP050
(useless-class-metaclass-type
) (#18334) - [
flake8-use-pathlib
] Replaceos.symlink
withPath.symlink_to
(PTH211
) (#18337)
Bug fixes
- [
flake8-bugbear
] Ignore__debug__
attribute inB010
(#18357) - [
flake8-async
] Fixanyio.sleep
argument name (ASYNC115
,ASYNC116
) (#18262) - [
refurb
] FixFURB129
autofix generating invalid syntax (#18235)
Rule changes
- [
flake8-implicit-str-concat
] Add autofix forISC003
(#18256) - [
pycodestyle
] Improve the diagnostic message forE712
(#18328) - [
flake8-2020
] Fix diagnostic message for!=
comparisons (YTT201
) (#18293) - [
pyupgrade
] Make fix unsafe if it deletes comments (UP010
) (#18291)
Documentation
- Simplify rules table to improve readability (#18297)
- Update editor integrations link in README (#17977)
- [
flake8-bugbear
] Add fix safety section (B006
) (#17652)
Contributors
- @AlexWaygood
- @CodeMan62
- @InSyncWithFoo
- @Kalmaegi
- @LaBatata101
- @Lee-W
- @MaddyGuthridge
- @MatthewMckee4
- @MichaReiser
- @Vasanth-96
- @carljm
- @charliermarsh
- @chirizxc
- @dcreager
- @dhruvmanila
- @dsherret
- @dylwil3
- @felixscherz
- @fennr
- @j178
- @lipefree
- @maxmynter
- @ntBre
- @otakutyrant
- @renovate
- @sharkdp
- @thejchap
- @vjurczenia
Install ruff 0.11.12
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.11.12/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ruff/releases/download/0.11.12/ruff-installer.ps1 | iex"
Download ruff 0.11.12
v0.11.11
Release Notes
Preview features
- [
airflow
] Add autofixes forAIR302
andAIR312
(#17942) - [
airflow
] Move rules fromAIR312
toAIR302
(#17940) - [
airflow
] UpdateAIR301
andAIR311
with the latest Airflow implementations (#17985) - [
flake8-simplify
] Enable fix in preview mode (SIM117
) (#18208)
Bug fixes
- Fix inconsistent formatting of match-case on
[]
and_
(#18147) - [
pylint
] FixPLW1514
not recognizing theencoding
positional argument ofcodecs.open
(#18109)
CLI
- Add full option name in formatter warning (#18217)
Documentation
- Fix rendering of admonition in docs (#18163)
- [
flake8-print
] Improve print/pprint docs forT201
andT203
(#18130) - [
flake8-simplify
] Add fix safety section (SIM110
,SIM210
) (#18114,#18100) - [
pylint
] Fix docs example that produced different output (PLW0603
) (#18216)
Contributors
- @AlexWaygood
- @BradonZhang
- @BurntSushi
- @CodeMan62
- @InSyncWithFoo
- @LaBatata101
- @Lee-W
- @Mathemmagician
- @MatthewMckee4
- @MichaReiser
- @TomerBin
- @VascoSch92
- @adamaaronson
- @brainwane
- @brandtbucher
- @carljm
- @dcreager
- @dhruvmanila
- @dragon-dxw
- @felixscherz
- @kiran-4444
- @maxmynter
- @ntBre
- @renovate
- @sharkdp
- @thejchap
- @twentyone212121
Install ruff 0.11.11
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.11.11/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ruff/releases/download/0.11.11/ruff-installer.ps1 | iex"
Download ruff 0.11.11
v0.11.10
Release Notes
Preview features
- [
ruff
] Implement a recursive check forRUF060
(#17976) - [
airflow
] Enable autofixes forAIR301
andAIR311
(#17941) - [
airflow
] Apply try catch guard to allAIR3
rules (#17887) - [
airflow
] ExtendAIR311
rules (#17913)
Bug fixes
- [
flake8-bugbear
] IgnoreB028
ifskip_file_prefixes
is present (#18047) - [
flake8-pie
] Mark autofix forPIE804
as unsafe if the dictionary contains comments (#18046) - [
flake8-simplify
] Correct behavior forstr.split
/rsplit
withmaxsplit=0
(SIM905
) (#18075) - [
flake8-simplify
] FixSIM905
autofix forrsplit
creating a reversed list literal (#18045) - [
flake8-use-pathlib
] Suppress diagnostics for allos.*
functions that have thedir_fd
parameter (PTH
) (#17968) - [
refurb
] Mark autofix as safe only for number literals (FURB116
) (#17692)
Rule changes
- [
flake8-bandit
] SkipS608
for expressionless f-strings (#17999) - [
flake8-pytest-style
] Don't recommendusefixtures
forparametrize
values (PT019
) (#17650) - [
pyupgrade
] Addresource.error
as deprecated alias ofOSError
(UP024
) (#17933)
CLI
- Disable jemalloc on Android (#18033)
Documentation
- Update Neovim setup docs (#18108)
- [
flake8-simplify
] Add fix safety section (SIM103
) (#18086) - [
flake8-simplify
] Add fix safety section (SIM112
) (#18099) - [
pylint
] Add fix safety section (PLC0414
) (#17802) - [
pylint
] Add fix safety section (PLE4703
) (#17824) - [
pylint
] Add fix safety section (PLW1514
) (#17932) - [
pylint
] Add fix safety section (PLW3301
) (#17878) - [
ruff
] Add fix safety section (RUF007
) (#17755) - [
ruff
] Add fix safety section (RUF033
) (#17760)
Contributors
- @AlexWaygood
- @BurntSushi
- @DimitriPapadopoulos
- @InSyncWithFoo
- @LaBatata101
- @Lee-W
- @MichaReiser
- @Rogdham
- @Usul-Dev
- @VascoSch92
- @abhijeetbodas2001
- @bombsimon
- @carljm
- @charliermarsh
- @danparizher
- @dcreager
- @dhruvmanila
- @github-actions
- @ibraheemdev
- @kiran-4444
- @lukeanderson93
- @maxmynter
- @mtshiba
- @naslundx
- @ntBre
- @omahs
- @renovate
- @sharkdp
- @swnb
- @yunchipang
- @zanieb
Install ruff 0.11.10
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.11.10/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ruff/releases/download/0.11.10/ruff-installer.ps1 | iex"
Download ruff 0.11.10
v0.11.9
Release Notes
Preview features
- Default to latest supported Python version for version-related syntax errors (#17529)
- Implement deferred annotations for Python 3.14 (#17658)
- [
airflow
] FixSQLTableCheckOperator
typo (AIR302
) (#17946) - [
airflow
] Removeairflow.utils.dag_parsing_context.get_parsing_context
(AIR301
) (#17852) - [
airflow
] Skip attribute check in try catch block (AIR301
) (#17790) - [
flake8-bandit
] Mark tuples of string literals as trusted input inS603
(#17801) - [
isort
] Check full module path against project root(s) when categorizing first-party imports (#16565) - [
ruff
] Add new rulein-empty-collection
(RUF060
) (#16480)
Bug fixes
- Fix missing
combine
call forlint.typing-extensions
setting (#17823) - [
flake8-async
] Fix module name inASYNC110
,ASYNC115
, andASYNC116
fixes (#17774) - [
pyupgrade
] Add spaces between tokens as necessary to avoid syntax errors inUP018
autofix (#17648) - [
refurb
] Fix false positive for float and complex numbers inFURB116
(#17661) - [parser] Flag single unparenthesized generator expr with trailing comma in arguments. (#17893)
Documentation
- Add instructions on how to upgrade to a newer Rust version (#17928)
- Update code of conduct email address (#17875)
- Add fix safety sections to
PLC2801
,PLR1722
, andRUF013
(#17825, #17826, #17759) - Add link to
check-typed-exception
fromS110
andS112
(#17786)
Other changes
- Allow passing a virtual environment to
ruff analyze graph
(#17743)
Contributors
- @AlexWaygood
- @BurntSushi
- @Gankra
- @Glyphack
- @InSyncWithFoo
- @LaBatata101
- @Lee-W
- @MichaReiser
- @VascoSch92
- @abhijeetbodas2001
- @carljm
- @charliermarsh
- @dcreager
- @dhruvmanila
- @dylwil3
- @ercbot
- @maxmynter
- @mtshiba
- @naslundx
- @ntBre
- @renovate
- @sharkdp
- @thejchap
- @yunchipang
- @zanieb
Install ruff 0.11.9
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.11.9/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ruff/releases/download/0.11.9/ruff-installer.ps1 | iex"
Download ruff 0.11.9
v0.11.8
Release Notes
Preview features
- [
airflow
] Apply auto fixes to cases where the names have changed in Airflow 3 (AIR302
,AIR311
) (#17553, #17570, #17571) - [
airflow
] ExtendAIR301
rule (#17598) - [
airflow
] Update existingAIR302
rules with better suggestions (#17542) - [
refurb
] Mark fix as safe forreadlines-in-for
(FURB129
) (#17644) - [syntax-errors]
nonlocal
declaration at module level (#17559) - [syntax-errors] Detect single starred expression assignment
x = *y
(#17624)
Bug fixes
- [
flake8-pyi
] EnsureLiteral[None,] | Literal[None,]
is not autofixed toNone | None
(PYI061
) (#17659) - [
flake8-use-pathlib
] Avoid suggestingPath.iterdir()
foros.listdir
with file descriptor (PTH208
) (#17715) - [
flake8-use-pathlib
] FixPTH104
false positive whenrename
is passed a file descriptor (#17712) - [
flake8-use-pathlib
] FixPTH116
false positive whenstat
is passed a file descriptor (#17709) - [
flake8-use-pathlib
] FixPTH123
false positive whenopen
is passed a file descriptor from a function call (#17705) - [
pycodestyle
] Fix duplicated diagnostic inE712
(#17651) - [
pylint
] Detectglobal
declarations in module scope (PLE0118
) (#17411) - [syntax-errors] Make
async-comprehension-in-sync-comprehension
more specific (#17460)
Configuration
- Add option to disable
typing_extensions
imports (#17611)
Documentation
- Fix example syntax for the
lint.pydocstyle.ignore-var-parameters
option (#17740) - Add fix safety sections (
ASYNC116
,FLY002
,D200
,RUF005
,RUF017
,RUF027
,RUF028
,RUF057
) (#17497, #17496, #17502, #17484, #17480, #17485, #17722, #17483)
Other changes
- Add Python 3.14 to configuration options (#17647)
- Make syntax error for unparenthesized except tuples version specific to before 3.14 (#17660)
Contributors
- @AlexWaygood
- @BurntSushi
- @Jie211
- @Kalmaegi
- @LaBatata101
- @Lee-W
- @MichaReiser
- @VascoSch92
- @abhijeetbodas2001
- @brendancooley
- @carljm
- @dcreager
- @dhruvmanila
- @dylwil3
- @github-actions
- @maxmynter
- @ntBre
- @renovate
- @sharkdp
- @thejchap
Install ruff 0.11.8
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.11.8/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ruff/releases/download/0.11.8/ruff-installer.ps1 | iex"
Download ruff 0.11.8
v0.11.7
Release Notes
Preview features
- [
airflow
] Apply auto fixes to cases where the names have changed in Airflow 3 (AIR301
) (#17355) - [
perflint
] Implement fix formanual-dict-comprehension
(PERF403
) (#16719) - [syntax-errors] Make duplicate parameter names a semantic error (#17131)
Bug fixes
- [
airflow
] Fix typos in provider package names (AIR302
,AIR312
) (#17574) - [
flake8-type-checking
] Visit keyword arguments in checks involvingtyping.cast
/typing.NewType
arguments (#17538) - [
pyupgrade
] Preserve parenthesis when fixing native literals containing newlines (UP018
) (#17220) - [
refurb
] Mark theFURB161
fix unsafe except for integers and booleans (#17240)
Rule changes
- [
perflint
] Allow list function calls to be replaced with a comprehension (PERF401
) (#17519) - [
pycodestyle
] Auto-fix redundant boolean comparison (E712
) (#17090) - [
pylint
] make fix unsafe if delete comments (PLR1730
) (#17459)
Documentation
Contributors
- @AlexWaygood
- @BurntSushi
- @Daverball
- @Gankra
- @Glyphack
- @Kalmaegi
- @Lee-W
- @MatthewMckee4
- @MichaReiser
- @VascoSch92
- @camper42
- @carljm
- @dcreager
- @dhruvmanila
- @ericmarkmartin
- @jnooree
- @knavdeep152002
- @maxmynter
- @mtshiba
- @ntBre
- @renovate
- @sharkdp
- @w0nder1ng
Install ruff 0.11.7
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.11.7/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ruff/releases/download/0.11.7/ruff-installer.ps1 | iex"
Download ruff 0.11.7
v0.11.6
Release Notes
Preview features
- Avoid adding whitespace to the end of a docstring after an escaped quote (#17216)
- [
airflow
] ExtractAIR311
fromAIR301
rules (AIR301
,AIR311
) (#17310, #17422)
Bug fixes
- Raise syntax error when
\
is at end of file (#17409)
Contributors
- @AlexWaygood
- @BurntSushi
- @Lee-W
- @MatthewMckee4
- @MichaReiser
- @cake-monotone
- @carljm
- @charliermarsh
- @dcreager
- @dhruvmanila
- @github-actions
- @maxmynter
- @mishamsk
- @mtshiba
- @ntBre
- @renovate
- @sharkdp
Install ruff 0.11.6
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.11.6/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ruff/releases/download/0.11.6/ruff-installer.ps1 | iex"
Download ruff 0.11.6
v0.11.5
Release Notes
Preview features
- [
airflow
] Add missingAIR302
attribute check (#17115) - [
airflow
] Expand module path check to individual symbols (AIR302
) (#17278) - [
airflow
] ExtractAIR312
fromAIR302
rules (AIR302
,AIR312
) (#17152) - [
airflow
] Update oudatedAIR301
,AIR302
rules (#17123) - [syntax-errors] Async comprehension in sync comprehension (#17177)
- [syntax-errors] Check annotations in annotated assignments (#17283)
- [syntax-errors] Extend annotation checks to
await
(#17282)
Bug fixes
- [
flake8-pie
] Avoid false positive for multiple assignment withauto()
(PIE796
) (#17274)
Rule changes
- [
ruff
] FixRUF100
to detect unused file-levelnoqa
directives with specific codes (#17042) (#17061) - [
flake8-pytest-style
] Avoid false positive for legacy form ofpytest.raises
(PT011
) (#17231)
Documentation
- Fix formatting of "See Style Guide" link (#17272)
Contributors
- @AlexWaygood
- @BurntSushi
- @Gankra
- @InSyncWithFoo
- @Lee-W
- @MatthewMckee4
- @MichaReiser
- @Skylion007
- @browniebroke
- @cake-monotone
- @carljm
- @dcreager
- @maxmynter
- @mishamsk
- @ntBre
- @renovate
- @sharkdp
- @twentyone212121
Install ruff 0.11.5
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.11.5/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ruff/releases/download/0.11.5/ruff-installer.ps1 | iex"
Download ruff 0.11.5
v0.11.4
Release Notes
Preview features
- [
ruff
] Implementinvalid-rule-code
asRUF102
(#17138) - [syntax-errors] Detect duplicate keys in
match
mapping patterns (#17129) - [syntax-errors] Detect duplicate attributes in
match
class patterns (#17186) - [syntax-errors] Detect invalid syntax in annotations (#17101)
Bug fixes
- [syntax-errors] Fix multiple assignment error for class fields in
match
patterns (#17184) - Don't skip visiting non-tuple slice in
typing.Annotated
subscripts (#17201)
Contributors
- @AlexWaygood
- @Daverball
- @Gankra
- @MichaReiser
- @carljm
- @dcreager
- @dylwil3
- @maxmynter
- @ntBre
- @sharkdp
Install ruff 0.11.4
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.11.4/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ruff/releases/download/0.11.4/ruff-installer.ps1 | iex"
Download ruff 0.11.4
v0.11.3
Release Notes
Preview features
- [
airflow
] Add more autofixes forAIR302
(#16876, #16977, #16976, #16965) - [
airflow
] MoveAIR301
toAIR002
(#16978) - [
airflow
] MoveAIR302
toAIR301
andAIR303
toAIR302
(#17151) - [
flake8-bandit
] Markstr
andlist[str]
literals as trusted input (S603
) (#17136) - [
ruff
] Support slices inRUF005
(#17078) - [syntax-errors] Start detecting compile-time syntax errors (#16106)
- [syntax-errors] Duplicate type parameter names (#16858)
- [syntax-errors] Irrefutable
case
pattern before final case (#16905) - [syntax-errors] Multiple assignments in
case
pattern (#16957) - [syntax-errors] Single starred assignment target (#17024)
- [syntax-errors] Starred expressions in
return
,yield
, andfor
(#17134) - [syntax-errors] Store to or delete
__debug__
(#16984)
Bug fixes
- Error instead of
panic!
when running Ruff from a deleted directory (#16903) (#17054) - [syntax-errors] Fix false positive for parenthesized tuple index (#16948)
CLI
- Check
pyproject.toml
correctly when it is passed via stdin (#16971)
Configuration
- [
flake8-import-conventions
] Add importnumpy.typing as npt
to defaultflake8-import-conventions.aliases
(#17133)
Documentation
- [
refurb
] Document whyUserDict
,UserList
, andUserString
are preferred overdict
,list
, andstr
(FURB189
) (#16927)
Contributors
- @AlexWaygood
- @BurntSushi
- @InSyncWithFoo
- @Lee-W
- @MatthewMckee4
- @MichaReiser
- @VascoSch92
- @akx
- @alex-700
- @amin-not-found
- @ashb
- @cake-monotone
- @carljm
- @dan-wilton
- @dcreager
- @dhruvmanila
- @dylwil3
- @ericmarkmartin
- @github-actions
- @john-science
- @manzt
- @maxmynter
- @mishamsk
- @mtshiba
- @ntBre
- @renovate
- @sharkdp
- @trag1c
Install ruff 0.11.3
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.11.3/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -ExecutionPolicy ByPass -c "irm https://github.com/astral-sh/ruff/releases/download/0.11.3/ruff-installer.ps1 | iex"
Download ruff 0.11.3
v0.11.2
Release Notes
Preview features
- [syntax-errors] Fix false-positive syntax errors emitted for annotations on variadic parameters before Python 3.11 (#16878)
Contributors
Install ruff 0.11.2
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.11.2/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -ExecutionPolicy ByPass -c "irm https://github.com/astral-sh/ruff/releases/download/0.11.2/ruff-installer.ps1 | iex"
Download ruff 0.11.2
v0.11.1
Release Notes
Preview features
- [
airflow
] Addchain
,chain_linear
andcross_downstream
forAIR302
(#16647) - [syntax-errors] Improve error message and range for pre-PEP-614 decorator syntax errors (#16581)
- [syntax-errors] PEP 701 f-strings before Python 3.12 (#16543)
- [syntax-errors] Parenthesized context managers before Python 3.9 (#16523)
- [syntax-errors] Star annotations before Python 3.11 (#16545)
- [syntax-errors] Star expression in index before Python 3.11 (#16544)
- [syntax-errors] Unparenthesized assignment expressions in sets and indexes (#16404)
Bug fixes
- Server: Allow
FixAll
action in presence of version-specific syntax errors (#16848) - [
flake8-bandit
] Allow raw strings insuspicious-mark-safe-usage
(S308
) #16702 (#16770) - [
refurb
] Avoid panickingunwrap
inverbose-decimal-constructor
(FURB157
) (#16777) - [
refurb
] Fix starred expressions fix (FURB161
) (#16550) - Fix
--statistics
reporting for unsafe fixes (#16756)
Rule changes
- [
flake8-executables
] Allowuv run
in shebang line forshebang-missing-python
(EXE003
) (#16849,#16855)
CLI
- Add
--exit-non-zero-on-format
(#16009)
Documentation
- Update Ruff tutorial to avoid non-existent fix in
__init__.py
(#16818) - [
flake8-gettext
] Swapformat-
andprintf-in-get-text-func-call
examples (INT002
,INT003
) (#16769)
Contributors
- @AlexWaygood
- @BurntSushi
- @InSyncWithFoo
- @MatthewMckee4
- @MichaReiser
- @VascoSch92
- @ZedThree
- @cake-monotone
- @carljm
- @charliermarsh
- @dcreager
- @dhruvmanila
- @dylwil3
- @github-actions
- @junhsonjb
- @kaxil
- @mfontanaar
- @ntBre
- @renovate
- @sharkdp
- @thejcannon
- @zanieb
Install ruff 0.11.1
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.11.1/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -ExecutionPolicy ByPass -c "irm https://github.com/astral-sh/ruff/releases/download/0.11.1/ruff-installer.ps1 | iex"
Download ruff 0.11.1
v0.11.0
Release Notes
This is a follow-up to release 0.10.0. The requires-python
inference changes were unintentionally omitted from 0.10.0, and have been included here. This release also includes stabilization of the preview behavior for PGH004
.
Breaking changes
-
Changes to how the Python version is inferred when a
target-version
is not specified (#16319)In previous versions of Ruff, you could specify your Python version with:
- The
target-version
option in aruff.toml
file or the[tool.ruff]
section of a pyproject.toml file. - The
project.requires-python
field in apyproject.toml
file with a[tool.ruff]
section.
These options worked well in most cases, and are still recommended for fine control of the Python version. However, because of the way Ruff discovers config files,
pyproject.toml
files without a[tool.ruff]
section would be ignored, including therequires-python
setting. Ruff would then use the default Python version (3.9 as of this writing) instead, which is surprising when you've attempted to request another version.In v0.10, config discovery has been updated to address this issue:
- If Ruff finds a
ruff.toml
file without atarget-version
, it will check for apyproject.toml
file in the same directory and respect itsrequires-python
version, even if it does not contain a[tool.ruff]
section. - If Ruff finds a user-level configuration, the
requires-python
field of the closestpyproject.toml
in a parent directory will take precedence. - If there is no config file (
ruff.toml
orpyproject.toml
with a[tool.ruff]
section) in the directory of the file being checked, Ruff will search for the closestpyproject.toml
in the parent directories and use itsrequires-python
setting.
- The
Stabilization
The following behaviors have been stabilized:
-
blanket-noqa
(PGH004
): Also detect blanked file-level noqa comments (and not just line level comments).
Preview features
- [syntax-errors] Tuple unpacking in
for
statement iterator clause before Python 3.9 (#16558)
Install ruff 0.11.0
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.11.0/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -ExecutionPolicy ByPass -c "irm https://github.com/astral-sh/ruff/releases/download/0.11.0/ruff-installer.ps1 | iex"
Download ruff 0.11.0
v0.10.0
Release Notes
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.
-
Changes to how the Python version is inferred when a
target-version
is not specified (#16319)While this change was intended to be released in 0.10.0, it was unintentionally omitted. It was subsequently released in 0.11.0 — see the changelog there for details.
-
Updated
TYPE_CHECKING
behavior (#16669)Previously, Ruff only recognized typechecking blocks that tested the
typing.TYPE_CHECKING
symbol. Now, Ruff recognizes any local variable namedTYPE_CHECKING
. This release also removes support for the legacyif 0:
andif False:
typechecking checks. Use a localTYPE_CHECKING
variable instead. -
More robust noqa parsing (#16483)
The syntax for both file-level and in-line suppression comments has been unified and made more robust to certain errors. In most cases, this will result in more suppression comments being read by Ruff, but there are a few instances where previously read comments will now log an error to the user instead. Please refer to the documentation on Error suppression for the full specification.
-
Avoid unnecessary parentheses around with statements with a single context manager and a trailing comment (#14005)
This change fixes a bug in the formatter where it introduced unnecessary parentheses around with statements with a single context manager and a trailing comment. This change may result in a change in formatting for some users.
-
Bump alpine default tag to 3.21 for derived Docker images (#16456)
Alpine 3.21 was released in Dec 2024 and is used in the official Alpine-based Python images. Now the ruff:alpine image will use 3.21 instead of 3.20 and ruff:alpine3.20 will no longer be updated.
Deprecated Rules
The following rules have been deprecated:
-
non-pep604-isinstance
(UP038
) -
suspicious-xmle-tree-usage
(S320
)
Remapped rules
The following rules have been remapped to new rule codes:
- [
unsafe-markup-use
]:RUF035
toS704
Stabilization
The following rules have been stabilized and are no longer in preview:
-
batched-without-explicit-strict
(B911
) -
unnecessary-dict-comprehension-for-iterable
(C420
) -
datetime-min-max
(DTZ901
) -
fast-api-unused-path-parameter
(FAST003
) -
root-logger-call
(LOG015
) -
len-test
(PLC1802
) -
shallow-copy-environ
(PLW1507
) -
os-listdir
(PTH208
) -
invalid-pathlib-with-suffix
(PTH210
) -
invalid-assert-message-literal-argument
(RUF040
) -
unnecessary-nested-literal
(RUF041
) -
unnecessary-cast-to-int
(RUF046
) -
map-int-version-parsing
(RUF048
) -
if-key-in-dict-del
(RUF051
) -
unsafe-markup-use
(S704
). This rule has also been renamed fromRUF035
. -
split-static-string
(SIM905
) -
runtime-cast-value
(TC006
) -
unquoted-type-alias
(TC007
) -
non-pep646-unpack
(UP044
)
The following behaviors have been stabilized:
-
bad-staticmethod-argument
(PLW0211
)invalid-first-argument-name-for-class-method
(N804
):__new__
methods are now no longer flagged byinvalid-first-argument-name-for-class-method
(N804
) but instead bybad-staticmethod-argument
(PLW0211
) -
bad-str-strip-call
(PLE1310
): The rule now applies to objects which are known to have typestr
orbytes
. -
custom-type-var-for-self
(PYI019
): More accurate detection of customTypeVars
replaceable bySelf
. The range of the diagnostic is now the full function header rather than just the return annotation. -
invalid-argument-name
(N803
): Ignore argument names of functions decorated withtyping.override
-
invalid-envvar-default
(PLW1508
): Detect default value arguments toos.environ.get
with invalid type. -
pytest-raises-with-multiple-statements
(PT012
)pytest-warns-with-multiple-statements
(PT031
): Allowfor
statements with an empty body inpytest.raises
andpytest.warns
with
statements. -
redundant-open-modes
(UP015
): The diagnostic range is now the range of the redundant mode argument where it previously was the range of the entire open call. You may have to replace yournoqa
comments when suppressingUP015
. -
stdlib-module-shadowing
(A005
): Changes the default value oflint.flake8-builtins.strict-checking
fromtrue
tofalse
. -
type-none-comparison
(FURB169
): Now also recognizestype(expr) is type(None)
comparisons whereexpr
isn't a name expression.
The following fixes or improvements to fixes have been stabilized:
-
repeated-equality-comparison
(PLR1714
) (#16685) -
needless-bool
(SIM103
) (#16684) -
unused-private-type-var
(PYI018
) (#16682)
Server
- Remove logging output for
ruff.printDebugInformation
(#16617)
Configuration
- [
flake8-builtins
] Deprecate thebuiltins-
prefixed options in favor of the unprefixed options (e.g.builtins-allowed-modules
is now deprecated in favor ofallowed-modules
) (#16092)
Bug fixes
- [flake8-bandit] Fix mixed-case hash algorithm names (S324) (#16552)
CLI
- [
ruff
] Fixlast_tag
/commits_since_last_tag
forversion
command (#16686)
Contributors
- @AlexWaygood
- @Glyphack
- @InSyncWithFoo
- @MichaReiser
- @VascoSch92
- @ZedThree
- @carljm
- @dcreager
- @dhruvmanila
- @dylwil3
- @ericmarkmartin
- @jgeralnik
- @mtshiba
- @ntBre
- @sharkdp
Install ruff 0.10.0
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.10.0/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -ExecutionPolicy ByPass -c "irm https://github.com/astral-sh/ruff/releases/download/0.10.0/ruff-installer.ps1 | iex"
Download ruff 0.10.0
v0.9.10
Release Notes
Preview features
- [
ruff
] Add new ruleRUF059
: Unused unpacked assignment (#16449) - [
syntax-errors
] Detect assignment expressions before Python 3.8 (#16383) - [
syntax-errors
] Named expressions in decorators before Python 3.9 (#16386) - [
syntax-errors
] Parenthesized keyword argument names after Python 3.8 (#16482) - [
syntax-errors
] Positional-only parameters before Python 3.8 (#16481) - [
syntax-errors
] Tuple unpacking inreturn
andyield
before Python 3.8 (#16485) - [
syntax-errors
] Type parameter defaults before Python 3.13 (#16447) - [
syntax-errors
] Type parameter lists before Python 3.12 (#16479) - [
syntax-errors
]except*
before Python 3.11 (#16446) - [
syntax-errors
]type
statements before Python 3.12 (#16478)
Bug fixes
- Escape template filenames in glob patterns in configuration (#16407)
- [
flake8-simplify
] Exempt unittest context methods forSIM115
rule (#16439) - Formatter: Fix syntax error location in notebooks (#16499)
- [
pyupgrade
] Do not offer fix when at least one target isglobal
/nonlocal
(UP028
) (#16451) - [
flake8-builtins
] Ignore variables matching module attribute names (A001
) (#16454) - [
pylint
] Convertcode
keyword argument to a positional argument in fix for (PLR1722
) (#16424)
CLI
- Move rule code from
description
tocheck_name
in GitLab output serializer (#16437)
Documentation
- [
pydocstyle
] Clarify thatD417
only checks docstrings with an arguments section (#16494)
Contributors
- @AlexWaygood
- @BurntSushi
- @Glyphack
- @InSyncWithFoo
- @JelleZijlstra
- @MichaReiser
- @VascoSch92
- @adamchainz
- @carljm
- @charliermarsh
- @dcreager
- @dhruvmanila
- @ericmarkmartin
- @github-actions
- @mishamsk
- @mtshiba
- @ntBre
- @renovate
- @sharkdp
Install ruff 0.9.10
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.9.10/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -ExecutionPolicy ByPass -c "irm https://github.com/astral-sh/ruff/releases/download/0.9.10/ruff-installer.ps1 | iex"
Download ruff 0.9.10
v0.9.9
Release Notes
Preview features
- Fix caching of unsupported-syntax errors (#16425)
Bug fixes
- Only show unsupported-syntax errors in editors when preview mode is enabled (#16429)
Contributors
Install ruff 0.9.9
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.9.9/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -ExecutionPolicy ByPass -c "irm https://github.com/astral-sh/ruff/releases/download/0.9.9/ruff-installer.ps1 | iex"
Download ruff 0.9.9
v0.9.8
Release Notes
Preview features
- Start detecting version-related syntax errors in the parser (#16090)
Rule changes
- [
pylint
] Mark fix unsafe (PLW1507
) (#16343) - [
pylint
] Catchcase np.nan
/case math.nan
inmatch
statements (PLW0177
) (#16378) - [
ruff
] Add more Pydantic models variants to the list of default copy semantics (RUF012
) (#16291)
Server
- Avoid indexing the project if
configurationPreference
iseditorOnly
(#16381) - Avoid unnecessary info at non-trace server log level (#16389)
- Expand
ruff.configuration
to allow inline config (#16296) - Notify users for invalid client settings (#16361)
Configuration
- Add
per-file-target-version
option (#16257)
Bug fixes
- [
refurb
] Do not consider docstring(s) (FURB156
) (#16391) - [
flake8-self
] Ignore attribute accesses on instance-like variables (SLF001
) (#16149) - [
pylint
] Fix false positives, add missing methods, and support positional-only parameters (PLE0302
) (#16263) - [
flake8-pyi
] MarkPYI030
fix unsafe when comments are deleted (#16322)
Documentation
- Fix example for
S611
(#16316) - Normalize inconsistent markdown headings in docstrings (#16364)
- Document MSRV policy (#16384)
Contributors
- @AlexWaygood
- @BurntSushi
- @CNSeniorious000
- @InSyncWithFoo
- @MichaReiser
- @VascoSch92
- @Viicos
- @aripollak
- @carljm
- @dcarrier
- @dcreager
- @dhruvmanila
- @mishamsk
- @ntBre
- @renovate
- @sharkdp
- @zanieb
Install ruff 0.9.8
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.9.8/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -ExecutionPolicy ByPass -c "irm https://github.com/astral-sh/ruff/releases/download/0.9.8/ruff-installer.ps1 | iex"
Download ruff 0.9.8
v0.9.7
Release Notes
Preview features
- Consider
__new__
methods as special function type for enforcing class method or static method rules (#13305) - [
airflow
] Improve the internal logic to differentiate deprecated symbols (AIR303
) (#16013) - [
refurb
] Manual timezone monkeypatching (FURB162
) (#16113) - [
ruff
] Implicit class variable in dataclass (RUF045
) (#14349) - [
ruff
] Skip singleton starred expressions forincorrectly-parenthesized-tuple-in-subscript
(RUF031
) (#16083) - [
refurb
] Check for subclasses includes subscript expressions (FURB189
) (#16155)
Rule changes
- [
flake8-debugger
] Also flagsys.breakpointhook
andsys.__breakpointhook__
(T100
) (#16191) - [
pycodestyle
] Exemptsite.addsitedir(...)
calls (E402
) (#16251)
Formatter
- Fix unstable formatting of trailing end-of-line comments of parenthesized attribute values (#16187)
Server
- Fix handling of requests received after shutdown message (#16262)
- Ignore
source.organizeImports.ruff
andsource.fixAll.ruff
code actions for a notebook cell (#16154) - Include document specific debug info for
ruff.printDebugInformation
(#16215) - Update server to return the debug info as string with
ruff.printDebugInformation
(#16214)
CLI
- Warn on invalid
noqa
even when there are no diagnostics (#16178) - Better error messages while loading configuration
extend
s (#15658)
Bug fixes
- [
flake8-comprehensions
] Handle trailing comma inC403
fix (#16110) - [
flake8-pyi
] Avoid flaggingcustom-typevar-for-self
on metaclass methods (PYI019
) (#16141) - [
pydocstyle
] Handle arguments with the same names as sections (D417
) (#16011) - [
pylint
] Correct ordering of arguments in fix forif-stmt-min-max
(PLR1730
) (#16080) - [
pylint
] Do not offer fix for raw strings (PLE251
) (#16132) - [
pyupgrade
] Do not upgrade functionalTypedDicts
with private field names to the class-based syntax (UP013
) (#16219) - [
pyupgrade
] Handle micro version numbers correctly (UP036
) (#16091) - [
pyupgrade
] Unwrap unary expressions correctly (UP018
) (#15919) - [
refurb
] Correctly handle lengths of literal strings inslice-to-remove-prefix-or-suffix
(FURB188
) (#16237) - [
ruff
] SkipRUF001
diagnostics when visiting string type definitions (#16122)
Documentation
Contributors
- @AlexWaygood
- @BurntSushi
- @Glyphack
- @InSyncWithFoo
- @Lee-W
- @MichaReiser
- @Skylion007
- @VascoSch92
- @ayushbaweja
- @cake-monotone
- @carljm
- @dcreager
- @dhruvmanila
- @dylwil3
- @github-actions
- @ibraheemdev
- @junhsonjb
- @ntBre
- @purajit
- @renovate
- @sharkdp
- @sobolevn
- @vladNed
Install ruff 0.9.7
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.9.7/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -ExecutionPolicy ByPass -c "irm https://github.com/astral-sh/ruff/releases/download/0.9.7/ruff-installer.ps1 | iex"
Download ruff 0.9.7
v0.9.6
Release Notes
Preview features
- [
airflow
] Addexternal_task.{ExternalTaskMarker, ExternalTaskSensor}
forAIR302
(#16014) - [
flake8-builtins
] Make strict module name comparison optional (A005
) (#15951) - [
flake8-pyi
] Extend fix to Python <= 3.9 forredundant-none-literal
(PYI061
) (#16044) - [
pylint
] Also report when the object isn't a literal (PLE1310
) (#15985) - [
ruff
] Implementindented-form-feed
(RUF054
) (#16049) - [
ruff
] Skip type definitions formissing-f-string-syntax
(RUF027
) (#16054)
Rule changes
- [
flake8-annotations
] Correct syntax fortyping.Union
in suggested return type fixes forANN20x
rules (#16025) - [
flake8-builtins
] Match upstream module name comparison (A005
) (#16006) - [
flake8-comprehensions
] Detect overshadowedlist
/set
/dict
, ignore variadics and named expressions (C417
) (#15955) - [
flake8-pie
] Remove following comma correctly when the unpacked dictionary is empty (PIE800
) (#16008) - [
flake8-simplify
] Only triggerSIM401
on known dictionaries (#15995) - [
pylint
] Do not report calls when object type and argument type mismatch, remove custom escape handling logic (PLE1310
) (#15984) - [
pyupgrade
] Comments within parenthesized value ranges should not affect applicability (UP040
) (#16027) - [
pyupgrade
] Don't introduce invalid syntax when upgrading old-style type aliases with parenthesized multiline values (UP040
) (#16026) - [
pyupgrade
] Ensure we do not rename two type parameters to the same name (UP049
) (#16038) - [
pyupgrade
] [ruff
] Don't apply renamings if the new name is shadowed in a scope of one of the references to the binding (UP049
,RUF052
) (#16032) - [
ruff
] UpdateRUF009
to behave similar toB008
and ignore attributes with immutable types (#16048)
Server
- Root exclusions in the server to project root (#16043)
Bug fixes
- [
flake8-datetime
] Ignore.replace()
calls while looking for.astimezone
(#16050) - [
flake8-type-checking
] AvoidTC004
false positive where the runtime definition is provided by__getattr__
(#16052)
Documentation
Contributors
- @AlexWaygood
- @Daverball
- @InSyncWithFoo
- @Lee-W
- @MichaReiser
- @carlosgmartin
- @dhruvmanila
- @dylwil3
- @junhsonjb
- @ntBre
- @renovate
- @sharkdp
- @smokyabdulrahman
Install ruff 0.9.6
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.9.6/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -ExecutionPolicy ByPass -c "irm https://github.com/astral-sh/ruff/releases/download/0.9.6/ruff-installer.ps1 | iex"
Download ruff 0.9.6
v0.9.5
Release Notes
Preview features
- Recognize all symbols named
TYPE_CHECKING
forin_type_checking_block
(#15719) - [
flake8-comprehensions
] Handle builtins at top of file correctly forunnecessary-dict-comprehension-for-iterable
(C420
) (#15837) - [
flake8-logging
].exception()
andexc_info=
outside exception handlers (LOG004
,LOG014
) (#15799) - [
flake8-pyi
] Fix incorrect behaviour ofcustom-typevar-return-type
preview-mode autofix iftyping
was already imported (PYI019
) (#15853) - [
flake8-pyi
] Fix more complex cases (PYI019
) (#15821) - [
flake8-pyi
] MakePYI019
autofixable for.py
files in preview mode as well as stubs (#15889) - [
flake8-pyi
] Remove type parameter correctly when it is the last (PYI019
) (#15854) - [
pylint
] Fix missing parens in unsafe fix forunnecessary-dunder-call
(PLC2801
) (#15762) - [
pyupgrade
] Better messages and diagnostic range (UP015
) (#15872) - [
pyupgrade
] Rename private type parameters in PEP 695 generics (UP049
) (#15862) - [
refurb
] Also report non-name expressions (FURB169
) (#15905) - [
refurb
] Mark fix as unsafe if there are comments (FURB171
) (#15832) - [
ruff
] Classes with mixed type variable style (RUF053
) (#15841) - [
airflow
]BashOperator
has been moved toairflow.providers.standard.operators.bash.BashOperator
(AIR302
) (#15922) - [
flake8-pyi
] Add autofix for unused-private-type-var (PYI018
) (#15999) - [
flake8-pyi
] Significantly improve accuracy ofPYI019
if preview mode is enabled (#15888)
Rule changes
- Preserve triple quotes and prefixes for strings (#15818)
- [
flake8-comprehensions
] Skip whenTypeError
present from too many (kw)args forC410
,C411
, andC418
(#15838) - [
flake8-pyi
] RenamePYI019
and improve its diagnostic message (#15885) - [
pep8-naming
] Ignore@override
methods (N803
) (#15954) - [
pyupgrade
] Reuse replacement logic fromUP046
andUP047
to preserve more comments (UP040
) (#15840) - [
ruff
] Analyze deferred annotations before enforcingmutable-(data)class-default
andfunction-call-in-dataclass-default-argument
(RUF008
,RUF009
,RUF012
) (#15921) - [
pycodestyle
] Exemptsys.path += ...
calls (E402
) (#15980)
Configuration
- Config error only when
flake8-import-conventions
alias conflicts withisort.required-imports
bound name (#15918) - Workaround Even Better TOML crash related to
allOf
(#15992)
Bug fixes
- [
flake8-comprehensions
] Unnecessarylist
comprehension (rewrite as aset
comprehension) (C403
) - Handle extraneous parentheses around list comprehension (#15877) - [
flake8-comprehensions
] Handle trailing comma in fixes forunnecessary-generator-list/set
(C400
,C401
) (#15929) - [
flake8-pyi
] Fix several correctness issues withcustom-type-var-return-type
(PYI019
) (#15851) - [
pep8-naming
] Consider any number of leading underscore forN801
(#15988) - [
pyflakes
] Visit forward annotations inTypeAliasType
as types (F401
) (#15829) - [
pylint
] Correct min/max auto-fix and suggestion for (PL1730
) (#15930) - [
refurb
] Handle unparenthesized tuples correctly (FURB122
,FURB142
) (#15953) - [
refurb
] AvoidNone | None
as well as better detection and fix (FURB168
) (#15779)
Documentation
- Add deprecation warning for
ruff-lsp
related settings (#15850) - Docs (
linter.md
): clarify that Python files are always searched for in subdirectories (#15882) - Fix a typo in
non_pep695_generic_class.rs
(#15946) - Improve Docs: Pylint subcategories' codes (#15909)
- Remove non-existing
lint.extendIgnore
editor setting (#15844) - Update black deviations (#15928)
- Mention
UP049
inUP046
andUP047
, addSee also
section toUP040
(#15956) - Add instance variable examples to
RUF012
(#15982) - Explain precedence for
ignore
andselect
config (#15883)
Contributors
- @AlexWaygood
- @BurntSushi
- @Daverball
- @InSyncWithFoo
- @Lee-W
- @MichaReiser
- @RayBB
- @VascoSch92
- @anordin95
- @ayushbaweja
- @carljm
- @dcreager
- @dhruvmanila
- @dylwil3
- @github-actions
- @jbramley
- @mishamsk
- @ntBre
- @renovate
- @sharkdp
- @tjkuson
- @zanieb
Install ruff 0.9.5
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.9.5/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -ExecutionPolicy ByPass -c "irm https://github.com/astral-sh/ruff/releases/download/0.9.5/ruff-installer.ps1 | iex"
Download ruff 0.9.5
v0.9.4
Release Notes
Preview features
- [
airflow
] Extend airflow context parameter check forBaseOperator.execute
(AIR302
) (#15713) - [
airflow
] UpdateAIR302
to check for deprecated context keys (#15144) - [
flake8-bandit
] Permit suspicious imports within stub files (S4
) (#15822) - [
pylint
] Do not triggerPLR6201
on empty collections (#15732) - [
refurb
] Do not emit diagnostic when loop variables are used outside loop body (FURB122
) (#15757) - [
ruff
] Add support for morere
patterns (RUF055
) (#15764) - [
ruff
] Check for shadowedmap
before suggesting fix (RUF058
) (#15790) - [
ruff
] Do not emit diagnostic when all arguments tozip()
are variadic (RUF058
) (#15744) - [
ruff
] Parenthesize fix when argument spans multiple lines forunnecessary-round
(RUF057
) (#15703)
Rule changes
- Preserve quote style in generated code (#15726, #15778, #15794)
- [
flake8-bugbear
] ExemptNewType
calls where the original type is immutable (B008
) (#15765) - [
pylint
] Honor banned top-level imports byTID253
inPLC0415
. (#15628) - [
pyupgrade
] Ignoreis_typeddict
andTypedDict
fordeprecated-import
(UP035
) (#15800)
CLI
- Fix formatter warning message for
flake8-quotes
option (#15788) - Implement tab autocomplete for
ruff config
(#15603)
Bug fixes
- [
flake8-comprehensions
] Do not emitunnecessary-map
diagnostic when lambda has different arity (C417
) (#15802) - [
flake8-comprehensions
] Parenthesizesorted
when needed forunnecessary-call-around-sorted
(C413
) (#15825) - [
pyupgrade
] Handle end-of-line comments forquoted-annotation
(UP037
) (#15824)
Documentation
- Add missing config docstrings (#15803)
- Add references to
trio.run_process
andanyio.run_process
(#15761) - Use
uv init --lib
in tutorial (#15718)
Contributors
- @AlexWaygood
- @Garrett-R
- @InSyncWithFoo
- @JelleZijlstra
- @Lee-W
- @MichaReiser
- @charliermarsh
- @dcreager
- @dhruvmanila
- @dylwil3
- @leotaku
- @marekhanus
- @mishamsk
- @naslundx
- @ntBre
- @renovate
- @sharkdp
- @sunank200
- @tjkuson
- @zanieb
Install ruff 0.9.4
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.9.4/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -ExecutionPolicy ByPass -c "irm https://github.com/astral-sh/ruff/releases/download/0.9.4/ruff-installer.ps1 | iex"
Download ruff 0.9.4
v0.9.3
Release Notes
Preview features
- [
airflow
] Argumentfail_stop
in DAG has been renamed asfail_fast
(AIR302
) (#15633) - [
airflow
] ExtendAIR303
with more symbols (#15611) - [
flake8-bandit
] Report all references to suspicious functions (S3
) (#15541) - [
flake8-pytest-style
] Do not emit diagnostics for emptyfor
loops (PT012
,PT031
) (#15542) - [
flake8-simplify
] Avoid double negations (SIM103
) (#15562) - [
pyflakes
] Fix infinite loop with unused local import in__init__.py
(F401
) (#15517) - [
pylint
] Do not report methods with only oneEM101
-compatibleraise
(PLR6301
) (#15507) - [
pylint
] Implementredefined-slots-in-subclass
(W0244
) (#9640) - [
pyupgrade
] Add rules to use PEP 695 generics in classes and functions (UP046
,UP047
) (#15565, #15659) - [
refurb
] Implementfor-loop-writes
(FURB122
) (#10630) - [
ruff
] Implementneedless-else
clause (RUF047
) (#15051) - [
ruff
] Implementstarmap-zip
(RUF058
) (#15483)
Rule changes
- [
flake8-bugbear
] Do not raise error if keyword argument is present and target-python version is less or equals than 3.9 (B903
) (#15549) - [
flake8-comprehensions
] strip parentheses around generators inunnecessary-generator-set
(C401
) (#15553) - [
flake8-pytest-style
] Rewrite references to.exception
(PT027
) (#15680) - [
flake8-simplify
] Mark fixes as unsafe (SIM201
,SIM202
) (#15626) - [
flake8-type-checking
] Fix some safe fixes being labeled unsafe (TC006
,TC008
) (#15638) - [
isort
] Omit trailing whitespace inunsorted-imports
(I001
) (#15518) - [
pydoclint
] Allow ignoring one line docstrings forDOC
rules (#13302) - [
pyflakes
] Apply redefinition fixes by source code order (F811
) (#15575) - [
pyflakes
] Avoid removing too many imports inredefined-while-unused
(F811
) (#15585) - [
pyflakes
] Group redefinition fixes by source statement (F811
) (#15574) - [
pylint
] Include name of base class in message forredefined-slots-in-subclass
(W0244
) (#15559) - [
ruff
] Update fix forRUF055
to usevar == value
(#15605)
Formatter
- Fix bracket spacing for single-element tuples in f-string expressions (#15537)
- Fix unstable f-string formatting for expressions containing a trailing comma (#15545)
Performance
- Avoid quadratic membership check in import fixes (#15576)
Server
- Allow
unsafe-fixes
settings for code actions (#15666)
Bug fixes
- [
flake8-bandit
] Add missing single-line/dotall regex flag (S608
) (#15654) - [
flake8-import-conventions
] Fix infinite loop betweenICN001
andI002
(ICN001
) (#15480) - [
flake8-simplify
] Do not emit diagnostics for expressions inside string type annotations (SIM222
,SIM223
) (#15405) - [
pyflakes
] Treat arguments passed to thedefault=
parameter ofTypeVar
as type expressions (F821
) (#15679) - [
pyupgrade
] Avoid syntax error when the iterable is a non-parenthesized tuple (UP028
) (#15543) - [
ruff
] ExemptNewType
calls where the original type is immutable (RUF009
) (#15588) - Preserve raw string prefix and escapes in all codegen fixes (#15694)
Documentation
- Generate documentation redirects for lowercase rule codes (#15564)
-
TRY300
: Add some extra notes on not catching exceptions you didn't expect (#15036)
Contributors
- @AlexWaygood
- @Daverball
- @InSyncWithFoo
- @Lee-W
- @MichaReiser
- @alex-700
- @augustelalande
- @calumy
- @charliermarsh
- @dcreager
- @dhruvmanila
- @dylwil3
- @guillaumeLepape
- @kiran-4444
- @ntBre
- @renovate
- @sharkdp
- @tsugumi-sys
- @wlach
- @wooly18
- @zanieb
Install ruff 0.9.3
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.9.3/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -ExecutionPolicy ByPass -c "irm https://github.com/astral-sh/ruff/releases/download/0.9.3/ruff-installer.ps1 | iex"
Download ruff 0.9.3
v0.9.2
Release Notes
Preview features
- [
airflow
] Fix typo "security_managr" to "security_manager" (AIR303
) (#15463) - [
airflow
] extend and fix AIR302 rules (#15525) - [
fastapi
] Handle parameters withDepends
correctly (FAST003
) (#15364) - [
flake8-pytest-style
] Implement pytest.warns diagnostics (PT029
,PT030
,PT031
) (#15444) - [
flake8-pytest-style
] Test function parameters with default arguments (PT028
) (#15449) - [
flake8-type-checking
] Avoid false positives for|
inTC008
(#15201)
Rule changes
- [
flake8-todos
] Allow VSCode GitHub MR extension style links inmissing-todo-link
(TD003
) (#15519) - [
pyflakes
] Show syntax error message forF722
(#15523)
Formatter
- Fix curly bracket spacing around f-string expressions containing curly braces (#15471)
- Fix joining of f-strings with different quotes when using quote style
Preserve
(#15524)
Server
- Avoid indexing the same workspace multiple times (#15495)
- Display context for
ruff.configuration
errors (#15452)
Configuration
- Remove
flatten
to improve deserialization error messages (#15414)
Bug fixes
- Parse triple-quoted string annotations as if parenthesized (#15387)
- [
fastapi
] UpdateAnnotated
fixes (FAST002
) (#15462) - [
flake8-bandit
] Check forbuiltins
instead ofbuiltin
(S102
,PTH123
) (#15443) - [
flake8-pathlib
] Fix--select
foros-path-dirname
(PTH120
) (#15446) - [
ruff
] Fix false positive on global keyword (RUF052
) (#15235)
Contributors
- @AlexWaygood
- @BurntSushi
- @Daverball
- @Garrett-R
- @Glyphack
- @InSyncWithFoo
- @Lee-W
- @MichaReiser
- @cake-monotone
- @carljm
- @charliermarsh
- @dhruvmanila
- @dylwil3
- @ntBre
- @renovate
- @sharkdp
- @tjkuson
Install ruff 0.9.2
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.9.2/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -ExecutionPolicy ByPass -c "irm https://github.com/astral-sh/ruff/releases/download/0.9.2/ruff-installer.ps1 | iex"
Download ruff 0.9.2
v0.9.1
Release Notes
Preview features
- [
pycodestyle
] Runtoo-many-newlines-at-end-of-file
on each cell in notebooks (W391
) (#15308) - [
ruff
] Omit diagnostic for shadowed private function parameters inused-dummy-variable
(RUF052
) (#15376)
Rule changes
- [
flake8-bugbear
] Improveassert-raises-exception
message (B017
) (#15389)
Formatter
- Preserve trailing end-of line comments for the last string literal in implicitly concatenated strings (#15378)
Server
- Fix a bug where the server and client notebooks were out of sync after reordering cells (#15398)
Bug fixes
- [
flake8-pie
] Correctly remove wrapping parentheses (PIE800
) (#15394) - [
pyupgrade
] Handle comments and multiline expressions correctly (UP037
) (#15337)
Contributors
- @AntoineD
- @InSyncWithFoo
- @MichaReiser
- @calumy
- @dcreager
- @dhruvmanila
- @dylwil3
- @sharkdp
- @tjkuson
Install ruff 0.9.1
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.9.1/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -ExecutionPolicy ByPass -c "irm https://github.com/astral-sh/ruff/releases/download/0.9.1/ruff-installer.ps1 | iex"
Download ruff 0.9.1
v0.9.0
Release Notes
Check out the blog post for a migration guide and overview of the changes!
Breaking changes
Ruff now formats your code according to the 2025 style guide. As a result, your code might now get formatted differently. See the formatter section for a detailed list of changes.
This release doesn’t remove or remap any existing stable rules.
Stabilization
The following rules have been stabilized and are no longer in preview:
-
stdlib-module-shadowing
(A005
). This rule has also been renamed: previously, it was calledbuiltin-module-shadowing
. -
builtin-lambda-argument-shadowing
(A006
) -
slice-to-remove-prefix-or-suffix
(FURB188
) -
boolean-chained-comparison
(PLR1716
) -
decimal-from-float-literal
(RUF032
) -
post-init-default
(RUF033
) -
useless-if-else
(RUF034
)
The following behaviors have been stabilized:
-
pytest-parametrize-names-wrong-type
(PT006
): Detectpytest.parametrize
calls outside decorators and calls with keyword arguments. -
module-import-not-at-top-of-file
(E402
): Ignorepytest.importorskip
calls between import statements. -
mutable-dataclass-default
(RUF008
) andfunction-call-in-dataclass-default-argument
(RUF009
): Add support forattrs
. -
bad-version-info-comparison
(PYI006
): Extend the rule to check non-stub files.
The following fixes or improvements to fixes have been stabilized:
-
redundant-numeric-union
(PYI041
) -
duplicate-union-members
(PYI016
)
Formatter
This release introduces the new 2025 stable style (#13371), stabilizing the following changes:
- Format expressions in f-string elements (#7594)
- Alternate quotes for strings inside f-strings (#13860)
- Preserve the casing of hex codes in f-string debug expressions (#14766)
- Choose the quote style for each string literal in an implicitly concatenated f-string rather than for the entire string (#13539)
- Automatically join an implicitly concatenated string into a single string literal if it fits on a single line (#9457)
- Remove the
ISC001
incompatibility warning (#15123) - Prefer parenthesizing the
assert
message over breaking the assertion expression (#9457) - Automatically parenthesize over-long
if
guards inmatch
case
clauses (#13513) - More consistent formatting for
match
case
patterns (#6933) - Avoid unnecessary parentheses around return type annotations (#13381)
- Keep the opening parentheses on the same line as the
if
keyword for comprehensions where the condition has a leading comment (#12282) - More consistent formatting for
with
statements with a single context manager for Python 3.8 or older (#10276) - Correctly calculate the line-width for code blocks in docstrings when using
max-doc-code-line-length = "dynamic"
(#13523)
Preview features
- [
flake8-bugbear
] Implementclass-as-data-structure
(B903
) (#9601) - [
flake8-type-checking
] Applyquoted-type-alias
more eagerly inTYPE_CHECKING
blocks and ignore it in stubs (TC008
) (#15180) - [
pylint
] Ignoreeq-without-hash
in stub files (PLW1641
) (#15310) - [
pyupgrade
] SplitUP007
into two individual rules:UP007
forUnion
andUP045
forOptional
(UP007
,UP045
) (#15313) - [
ruff
] New rule that detects classes that are both an enum and adataclass
(RUF049
) (#15299) - [
ruff
] RecodeRUF025
toRUF037
(RUF037
) (#15258)
Rule changes
- [
flake8-builtins
] Ignorestdlib-module-shadowing
in stub files(A005
) (#15350) - [
flake8-return
] Add support for functions returningtyping.Never
(RET503
) (#15298)
Server
- Improve the observability by removing the need for the "trace" value to turn on or off logging. The server logging is solely controlled using the
logLevel
server setting which defaults toinfo
. This addresses the issue where users were notified about an error and told to consult the log, but it didn’t contain any messages. (#15232) - Ignore diagnostics from other sources for code action requests (#15373)
CLI
- Improve the error message for
--config key=value
when thekey
is for a table and it’s a simplevalue
Bug fixes
- [
eradicate
] Ignore metadata blocks directly followed by normal blocks (ERA001
) (#15330) - [
flake8-django
] Recognize other magic methods (DJ012
) (#15365) - [
pycodestyle
] Avoid false positives related to type aliases (E252
) (#15356) - [
pydocstyle
] Avoid treating newline-separated sections as sub-sections (D405
) (#15311) - [
pyflakes
] Remove call when removing final argument fromformat
(F523
) (#15309) - [
refurb
] Mark fix as unsafe when the right-hand side is a string (FURB171
) (#15273) - [
ruff
] Treat)
as a regex metacharacter (RUF043
,RUF055
) (#15318) - [
ruff
] Parenthesize theint
-call argument when removing theint
call would change semantics (RUF046
) (#15277)
Contributors
- @AlexWaygood
- @Avasam
- @Daverball
- @Glyphack
- @InSyncWithFoo
- @MichaReiser
- @augustelalande
- @carljm
- @charliermarsh
- @dcreager
- @dhruvmanila
- @diceroll123
- @dylwil3
- @eclbg
- @rtpg
- @sharkdp
- @viccie30
Install ruff 0.9.0
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.9.0/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -ExecutionPolicy ByPass -c "irm https://github.com/astral-sh/ruff/releases/download/0.9.0/ruff-installer.ps1 | iex"
Download ruff 0.9.0
v0.8.6
Release Notes
Preview features
- [
format
]: Preserve multiline implicit concatenated strings in docstring positions (#15126) - [
ruff
] Add rule to detect empty literal in deque call (RUF025
) (#15104) - [
ruff
] Avoid reporting whenndigits
is possibly negative (RUF057
) (#15234)
Rule changes
- [
flake8-todos
] remove issue code length restriction (TD003
) (#15175) - [
pyflakes
] Ignore errors in@no_type_check
string annotations (F722
,F821
) (#15215)
CLI
- Show errors for attempted fixes only when passed
--verbose
(#15237)
Bug fixes
- [
ruff
] Avoid syntax error when removing int over multiple lines (RUF046
) (#15230) - [
pyupgrade
] Revert "Add all PEP-585 names toUP006
rule" (#15250)
Contributors
- @AlexWaygood
- @InSyncWithFoo
- @Lee-W
- @MichaReiser
- @augustelalande
- @charliermarsh
- @dcreager
- @dylwil3
- @mdbernard
- @sharkdp
- @w0nder1ng
Install ruff 0.8.6
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.8.6/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -ExecutionPolicy ByPass -c "irm https://github.com/astral-sh/ruff/releases/download/0.8.6/ruff-installer.ps1 | iex"
Download ruff 0.8.6
v0.8.5
Release Notes
Preview features
- [
airflow
] Extend names moved from core to provider (AIR303
) (#15145, #15159, #15196, #15216) - [
airflow
] Extend rule to check class attributes, methods, arguments (AIR302
) (#15054, #15083) - [
fastapi
] UpdateFAST002
to check keyword-only arguments (#15119) - [
flake8-type-checking
] DisableTC006
andTC007
in stub files (#15179) - [
pylint
] Detect nested methods correctly (PLW1641
) (#15032) - [
ruff
] Detect more strict-integer expressions (RUF046
) (#14833) - [
ruff
] Implementfalsy-dict-get-fallback
(RUF056
) (#15160) - [
ruff
] Implementunnecessary-round
(RUF057
) (#14828)
Rule changes
- Visit PEP 764 inline
TypedDict
keys as non-type-expressions (#15073) - [
flake8-comprehensions
] SkipC416
if comprehension contains unpacking (#14909) - [
flake8-pie
] Allowcast(SomeType, ...)
(PIE796
) (#15141) - [
flake8-simplify
] More precise inference for dictionaries (SIM300
) (#15164) - [
flake8-use-pathlib
] Catch redundant joins inPTH201
and avoid syntax errors (#15177) - [
pycodestyle
] Preserve original value format (E731
) (#15097) - [
pydocstyle
] Split on first whitespace character (D403
) (#15082) - [
pyupgrade
] Add all PEP-585 names toUP006
rule (#5454)
Configuration
- [
flake8-type-checking
] Improve flexibility ofruntime-evaluated-decorators
(#15204) - [
pydocstyle
] Add setting to ignore missing documentation for*args
and**kwargs
parameters (D417
) (#15210) - [
ruff
] Add an allowlist forunsafe-markup-use
(RUF035
) (#15076)
Bug fixes
- Fix type subscript on older python versions (#15090)
- Use
TypeChecker
for detectingfastapi
routes (#15093) - [
pycodestyle
] Avoid false positives and negatives related to type parameter default syntax (E225
,E251
) (#15214)
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)
Contributors
- @AlexWaygood
- @Avasam
- @Daverball
- @InSyncWithFoo
- @KotlinIsland
- @Lee-W
- @MichaReiser
- @TomerBin
- @Viicos
- @aaron-skydio
- @cclauss
- @dhruvmanila
- @dylwil3
- @enochkan
- @github-actions
- @guptaarnav
- @harupy
- @hauntsaninja
- @my1e5
- @purajit
- @renovate
- @sharkdp
- @sobolevn
- @wookie184
Install ruff 0.8.5
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.8.5/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -ExecutionPolicy ByPass -c "irm https://github.com/astral-sh/ruff/releases/download/0.8.5/ruff-installer.ps1 | iex"
Download ruff 0.8.5
v0.8.4
Release Notes
Preview features
- [
airflow
] ExtendAIR302
with additional functions and classes (#15015) - [
airflow
] Implementmoved-to-provider-in-3
for modules that has been moved to Airflow providers (AIR303
) (#14764) - [
flake8-use-pathlib
] Extend check for invalid path suffix to include the case"."
(PTH210
) (#14902) - [
perflint
] Fix panic inPERF401
when list variable is after thefor
loop (#14971) - [
perflint
] Simplify finding the loop target inPERF401
(#15025) - [
pylint
] Preserve original value format (PLR6104
) (#14978) - [
ruff
] Avoid false positives forRUF027
for typing context bindings (#15037) - [
ruff
] Check for ambiguous pattern passed topytest.raises()
(RUF043
) (#14966)
Rule changes
- [
flake8-bandit
] CheckS105
for annotated assignment (#15059) - [
flake8-pyi
] More autofixes forredundant-none-literal
(PYI061
) (#14872) - [
pydocstyle
] Skip leading whitespace forD403
(#14963) - [
ruff
] SkipSQLModel
base classes formutable-class-default
(RUF012
) (#14949)
Bug
- [
perflint
] Parenthesize walrus expressions in autofix formanual-list-comprehension
(PERF401
) (#15050)
Server
- Check diagnostic refresh support from client capability which enables dynamic configuration for various editors (#15014)
Contributors
- @AlexWaygood
- @Daverball
- @DimitriPapadopoulos
- @InSyncWithFoo
- @Lee-W
- @MichaReiser
- @TheBits
- @cake-monotone
- @carljm
- @dcreager
- @dhruvmanila
- @dylwil3
- @github-actions
- @kiran-4444
- @krishnan-chandra
- @rchen152
- @renovate
- @sharkdp
- @tarasmatsyk
- @w0nder1ng
Install ruff 0.8.4
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.8.4/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -ExecutionPolicy ByPass -c "irm https://github.com/astral-sh/ruff/releases/download/0.8.4/ruff-installer.ps1 | iex"
Download ruff 0.8.4
v0.8.3
Release Notes
Preview features
- Fix fstring formatting removing overlong implicit concatenated string in expression part (#14811)
- [
airflow
] Add fix to remove deprecated keyword arguments (AIR302
) (#14887) - [
airflow
]: Extend rule to include deprecated names for Airflow 3.0 (AIR302
) (#14765 and #14804) - [
flake8-bugbear
] Improve error messages forexcept*
(B025
,B029
,B030
,B904
) (#14815) - [
flake8-bugbear
]itertools.batched()
without explicitstrict
(B911
) (#14408) - [
flake8-use-pathlib
] Dotless suffix passed toPath.with_suffix()
(PTH210
) (#14779) - [
pylint
] Include parentheses and multiple comparators in check forboolean-chained-comparison
(PLR1716
) (#14781) - [
ruff
] Do not simplifyround()
calls (RUF046
) (#14832) - [
ruff
] Don't emitused-dummy-variable
on function parameters (RUF052
) (#14818) - [
ruff
] Implementif-key-in-dict-del
(RUF051
) (#14553) - [
ruff
] Mark autofix forRUF052
as always unsafe (#14824) - [
ruff
] Teach autofix forused-dummy-variable
about TypeVars etc. (RUF052
) (#14819)
Rule changes
- [
flake8-bugbear
] Offer unsafe autofix forno-explicit-stacklevel
(B028
) (#14829) - [
flake8-pyi
] Skip all type definitions instring-or-bytes-too-long
(PYI053
) (#14797) - [
pyupgrade
] Do not report when a UTF-8 comment is followed by a non-UTF-8 one (UP009
) (#14728) - [
pyupgrade
] Mark fixes forconvert-typed-dict-functional-to-class
andconvert-named-tuple-functional-to-class
as unsafe if they will remove comments (UP013
,UP014
) (#14842)
Bug fixes
- Raise syntax error for mixing
except
andexcept*
(#14895) - [
flake8-bugbear
] FixB028
to allowstacklevel
to be explicitly assigned as a positional argument (#14868) - [
flake8-bugbear
] SkipB028
ifwarnings.warn
is called with*args
or**kwargs
(#14870) - [
flake8-comprehensions
] Skip iterables with named expressions inunnecessary-map
(C417
) (#14827) - [
flake8-pyi
] Also removeself
andcls
's annotation (PYI034
) (#14801) - [
flake8-pytest-style
] Fixpytest-parametrize-names-wrong-type
(PT006
) to edit bothargnames
andargvalues
if both of them are single-element tuples/lists (#14699) - [
perflint
] Improve autofix forPERF401
(#14369) - [
pylint
] FixPLW1508
false positive for default string created via a mult operation (#14841)
Contributors
- @AlexWaygood
- @BurntSushi
- @DimitriPapadopoulos
- @Glyphack
- @InSyncWithFoo
- @Lee-W
- @MichaReiser
- @UnknownPlatypus
- @carljm
- @cclauss
- @dcreager
- @dhruvmanila
- @dylwil3
- @harupy
- @mitya57
- @notpeter
- @ognevny
- @renovate
- @sharkdp
- @smokyabdulrahman
- @tirkarthi
- @w0nder1ng
Install ruff 0.8.3
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.8.3/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -ExecutionPolicy ByPass -c "irm https://github.com/astral-sh/ruff/releases/download/0.8.3/ruff-installer.ps1 | iex"
Download ruff 0.8.3
v0.8.2
Release Notes
Preview features
- [
airflow
] Avoid deprecated values (AIR302
) (#14582) - [
airflow
] Extend removed names forAIR302
(#14734) - [
ruff
] Extendunnecessary-regular-expression
to non-literal strings (RUF055
) (#14679) - [
ruff
] Implementused-dummy-variable
(RUF052
) (#14611) - [
ruff
] Implementunnecessary-cast-to-int
(RUF046
) (#14697)
Rule changes
- [
airflow
] CheckAIR001
from builtin or providersoperators
module (#14631) - [
flake8-pytest-style
] Remove@
inpytest.mark.parametrize
rule messages (#14770) - [
pandas-vet
] Skip rules if thepanda
module hasn't been seen (#14671) - [
pylint
] Fix false negatives forascii
andsorted
inlen-as-condition
(PLC1802
) (#14692) - [
refurb
] Guardhashlib
imports and markhashlib-digest-hex
fix as safe (FURB181
) (#14694)
Configuration
- [
flake8-import-conventions
] Improve syntax check for aliases supplied in configuration forunconventional-import-alias
(ICN001
) (#14745)
Bug fixes
- Revert: [pyflakes] Avoid false positives in
@no_type_check
contexts (F821
,F722
) (#14615) (#14726) - [
pep8-naming
] Avoid false positive forclass Bar(type(foo))
(N804
) (#14683) - [
pycodestyle
] Handle f-strings properly forinvalid-escape-sequence
(W605
) (#14748) - [
pylint
] Ignore@overload
inPLR0904
(#14730) - [
refurb
] Handle non-finite decimals inverbose-decimal-constructor
(FURB157
) (#14596) - [
ruff
] Avoid emittingassignment-in-assert
when all references to the assigned variable are themselves insideassert
s (RUF018
) (#14661)
Documentation
- Improve docs for
flake8-use-pathlib
rules (#14741) - Improve error messages and docs for
flake8-comprehensions
rules (#14729) - [
flake8-type-checking
] ExpandsTC006
docs to better explain itself (#14749)
Contributors
- @AlexWaygood
- @Daverball
- @InSyncWithFoo
- @Lee-W
- @Lokejoke
- @Matt-Ord
- @MichaReiser
- @Well2333
- @connorskees
- @dcreager
- @dhruvmanila
- @dylwil3
- @github-actions
- @harupy
- @ntBre
- @renovate
- @sbrugman
- @sharkdp
- @uranusjr
Install ruff 0.8.2
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.8.2/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -ExecutionPolicy ByPass -c "irm https://github.com/astral-sh/ruff/releases/download/0.8.2/ruff-installer.ps1 | iex"
Download ruff 0.8.2
v0.8.1
Release Notes
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
] Avoid implicitschedule
argument toDAG
and@dag
(AIR301
) (#14581) - [
flake8-builtins
] Exempt private built-in modules (A005
) (#14505) - [
flake8-pytest-style
] Fixpytest.mark.parametrize
rules to check calls instead of decorators (#14515) - [
flake8-type-checking
] Implementruntime-cast-value
(TC006
) (#14511) - [
flake8-type-checking
] Implementunquoted-type-alias
(TC007
) andquoted-type-alias
(TC008
) (#12927) - [
flake8-use-pathlib
] RecommendPath.iterdir()
overos.listdir()
(PTH208
) (#14509) - [
pylint
] Extendinvalid-envvar-default
to detectos.environ.get
(PLW1508
) (#14512) - [
pylint
] Implementlen-test
(PLC1802
) (#14309) - [
refurb
] Fix bug where methods defined using lambdas were flagged byFURB118
(#14639) - [
ruff
] Auto-addr
prefix when string has no backslashes forunraw-re-pattern
(RUF039
) (#14536) - [
ruff
] Implementinvalid-assert-message-literal-argument
(RUF040
) (#14488) - [
ruff
] Implementunnecessary-nested-literal
(RUF041
) (#14323) - [
ruff
] Implementunnecessary-regular-expression
(RUF055
) (#14659)
Rule changes
- Ignore more rules for stub files (#14541)
- [
pep8-naming
] Eliminate false positives for single-letter names (N811
,N814
) (#14584) - [
pyflakes
] Avoid false positives in@no_type_check
contexts (F821
,F722
) (#14615) - [
ruff
] Detect redirected-noqa in file-level comments (RUF101
) (#14635) - [
ruff
] Mark fixes forunsorted-dunder-all
andunsorted-dunder-slots
as unsafe when there are complex comments in the sequence (RUF022
,RUF023
) (#14560)
Bug fixes
- Avoid fixing code to
None | None
forredundant-none-literal
(PYI061
) andnever-union
(RUF020
) (#14583, #14589) - [
flake8-bugbear
] Fixmutable-contextvar-default
to resolve annotated function calls properly (B039
) (#14532) - [
flake8-pyi
,ruff
] Fix traversal of nested literals and unions (PYI016
,PYI051
,PYI055
,PYI062
,RUF041
) (#14641) - [
flake8-pyi
] Avoid rewriting invalid type expressions inunnecessary-type-union
(PYI055
) (#14660) - [
flake8-type-checking
] Avoid syntax errors and type checking problem for quoted annotations autofix (TC003
,TC006
) (#14634) - [
pylint
] Do not wrap function calls in parentheses in the fix for unnecessary-dunder-call (PLC2801
) (#14601) - [
ruff
] Handleattrs
'sauto_attribs
correctly (RUF009
) (#14520)
Contributors
- @AlexWaygood
- @Daverball
- @Glyphack
- @InSyncWithFoo
- @Lokejoke
- @MichaReiser
- @cake-monotone
- @carljm
- @charliermarsh
- @connorskees
- @dhruvmanila
- @dylwil3
- @harupy
- @njhearp
- @ntBre
- @renovate
- @sbrugman
- @sharkdp
- @snowdrop4
- @sransara
- @uranusjr
Install ruff 0.8.1
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.8.1/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -ExecutionPolicy ByPass -c "irm https://github.com/astral-sh/ruff/releases/download/0.8.1/ruff-installer.ps1 | iex"
Download ruff 0.8.1
v0.8.0
Release Notes
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-version
orproject.requires-python
(#13896) -
Changed location of
pydoclint
diagnosticspydoclint
diagnostics 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
noqa
comments in some places, this change may mean that you need to move thenoqa
suppression 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_HOME
or~/.cargo/bin
for 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
:TCH
toTC
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
] Exemptmin.time()
andmax.time()
(DTZ901
) (#14394) - [
flake8-pie
] Mark fix as unsafe if the following statement is a string literal (PIE790
) (#14393) - [
flake8-pyi
] New ruleredundant-none-literal
(PYI061
) (#14316) - [
flake8-pyi
] Add autofix forredundant-numeric-union
(PYI041
) (#14273) - [
ruff
] New rulemap-int-version-parsing
(RUF048
) (#14373) - [
ruff
] New ruleredundant-bool-literal
(RUF038
) (#14319) - [
ruff
] New ruleunraw-re-pattern
(RUF039
) (#14446) - [
pycodestyle
] Exemptpytest.importorskip()
calls (E402
) (#14474) - [
pylint
] Autofix suggests using sets when possible (PLR1714
) (#14372)
Rule changes
-
invalid-pyproject-toml
(RUF200
): Updated to reflect the provisionally accepted PEP 639. - [
flake8-pyi
] Avoid panic in unfixable case (PYI041
) (#14402) - [
flake8-type-checking
] Correctly handle quotes in subscript expression when generating an autofix (#14371) - [
pylint
] Suggest correct autofix for__contains__
(PLC2801
) (#14424)
Configuration
- Ruff now emits a warning instead of an error when a configuration
ignore
s a rule that has been removed (#14435) - Ruff now validates that
lint.flake8-import-conventions.aliases
only uses valid module names and aliases (#14477)
Contributors
- @AlexWaygood
- @CarrotManMatt
- @Daverball
- @Glyphack
- @InSyncWithFoo
- @MichaReiser
- @cake-monotone
- @charliermarsh
- @dhruvmanila
- @diceroll123
- @dylwil3
- @hauntsaninja
- @konstin
- @sbrugman
- @sharkdp
- @takaya0
- @tjkuson
- @zanieb
Install ruff 0.8.0
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.8.0/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -ExecutionPolicy ByPass -c "irm https://github.com/astral-sh/ruff/releases/download/0.8.0/ruff-installer.ps1 | iex"
Download ruff 0.8.0
v0.7.4
Release Notes
Preview features
- [
flake8-datetimez
] Detect usages ofdatetime.max
/datetime.min
(DTZ901
) (#14288) - [
flake8-logging
] Implementroot-logger-calls
(LOG015
) (#14302) - [
flake8-no-pep420
] Detect empty implicit namespace packages (INP001
) (#14236) - [
flake8-pyi
] Add "replace withSelf
" fix (PYI019
) (#14238) - [
perflint
] Implement quick-fix formanual-list-comprehension
(PERF401
) (#13919) - [
pylint
] Implementshallow-copy-environ
(W1507
) (#14241) - [
ruff
] Implementnone-not-at-end-of-union
(RUF036
) (#14314) - [
ruff
] Implementationunsafe-markup-call
fromflake8-markupsafe
plugin (RUF035
) (#14224) - [
ruff
] Report problems forattrs
dataclasses (RUF008
,RUF009
) (#14327)
Rule changes
- [
flake8-boolean-trap
] Exclude dunder methods that define operators (FBT001
) (#14203) - [
flake8-pyi
] Add "replace withSelf
" fix (PYI034
) (#14217) - [
flake8-pyi
] Always autofixduplicate-union-members
(PYI016
) (#14270) - [
flake8-pyi
] Improve autofix for nested and mixed type unions forunnecessary-type-union
(PYI055
) (#14272) - [
flake8-pyi
] Mark fix as unsafe when type annotation contains comments forduplicate-literal-member
(PYI062
) (#14268)
Server
- Use the current working directory to resolve settings from
ruff.configuration
(#14352)
Bug fixes
- Avoid conflicts between
PLC014
(useless-import-alias
) andI002
(missing-required-import
) by consideringlint.isort.required-imports
forPLC014
(#14287) - [
flake8-type-checking
] Skip quoting annotation if it becomes invalid syntax (TCH001
) - [
flake8-pyi
] Avoid usingtyping.Self
in stub files pre-Python 3.11 (PYI034
) (#14230) - [
flake8-pytest-style
] Flagpytest.raises
call with keyword argumentexpected_exception
(PT011
) (#14298) - [
flake8-simplify
] Infer "unknown" truthiness for literal iterables whose items are all unpacks (SIM222
) (#14263) - [
flake8-type-checking
] Fix false positives fortyping.Annotated
(TCH001
) (#14311) - [
pylint
] Allowawait
at the top-level scope of a notebook (PLE1142
) (#14225) - [
pylint
] Fix miscellaneous issues inawait-outside-async
detection (PLE1142
) (#14218) - [
pyupgrade
] Avoid applying PEP 646 rewrites in invalid contexts (UP044
) (#14234) - [
pyupgrade
] Detect permutations in redundant open modes (UP015
) (#14255) - [
refurb
] Avoid triggeringhardcoded-string-charset
for reordered sets (FURB156
) (#14233) - [
refurb
] Further special cases added toverbose-decimal-constructor
(FURB157
) (#14216) - [
refurb
] UseUserString
instead of non-existentUserStr
(FURB189
) (#14209) - [
ruff
] Avoid treating lowercase letters as# noqa
codes (RUF100
) (#14229) - [
ruff
] Do not report whenOptional
has no type arguments (RUF013
) (#14181)
Documentation
- Add "Notebook behavior" section for
F704
,PLE1142
(#14266) - Document comment policy around fix safety (#14300)
Contributors
- @AlexWaygood
- @Daverball
- @Glyphack
- @InSyncWithFoo
- @MichaReiser
- @carljm
- @charliermarsh
- @dhruvmanila
- @dylwil3
- @github-actions
- @harupy
- @nijel
- @pgiraud
- @randolf-scholz
- @renovate
- @sbrugman
- @sharkdp
- @w0nder1ng
Install ruff 0.7.4
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.7.4/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -ExecutionPolicy ByPass -c "irm https://github.com/astral-sh/ruff/releases/download/0.7.4/ruff-installer.ps1 | iex"
Download ruff 0.7.4
v0.7.3
Release Notes
Preview features
- Formatter: Disallow single-line implicit concatenated strings (#13928)
- [
flake8-pyi
] Include all Python file types forPYI006
andPYI066
(#14059) - [
flake8-simplify
] Implementsplit-of-static-string
(SIM905
) (#14008) - [
refurb
] Implementsubclass-builtin
(FURB189
) (#14105) - [
ruff
] Improve diagnostic messages and docs (RUF031
,RUF032
,RUF034
) (#14068)
Rule changes
- Detect items that hash to same value in duplicate sets (
B033
,PLC0208
) (#14064) - [
eradicate
] Better detection of IntelliJ language injection comments (ERA001
) (#14094) - [
flake8-pyi
] Add autofix fordocstring-in-stub
(PYI021
) (#14150) - [
flake8-pyi
] Updateduplicate-literal-member
(PYI062
) to alawys provide an autofix (#14188) - [
pyflakes
] Detect items that hash to same value in duplicate dictionaries (F601
) (#14065) - [
ruff
] Fix false positive for decorators (RUF028
) (#14061)
Bug fixes
- Avoid parsing joint rule codes as distinct codes in
# noqa
(#12809) - [
eradicate
] ignore# language=
in commented-out-code rule (ERA001) (#14069) - [
flake8-bugbear
] - do not runmutable-argument-default
on stubs (B006
) (#14058) - [
flake8-builtins
] Skip lambda expressions inbuiltin-argument-shadowing (A002)
(#14144) - [
flake8-comprehension
] Also remove trailing comma while fixingC409
andC419
(#14097) - [
flake8-simplify
] Allowopen
without context manager inreturn
statement (SIM115
) (#14066) - [
pylint
] Respect hash-equivalent literals initeration-over-set
(PLC0208
) (#14063) - [
pylint
] Update known dunder methods for Python 3.13 (PLW3201
) (#14146) - [
pyupgrade
] - ignore kwarg unpacking forUP044
(#14053) - [
refurb
] Parse more exotic decimal strings inverbose-decimal-constructor
(FURB157
) (#14098)
Documentation
- Add links to missing related options within rule documentations (#13971)
- Add rule short code to mkdocs tags to allow searching via rule codes (#14040)
Install ruff 0.7.3
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.7.3/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -ExecutionPolicy ByPass -c "irm https://github.com/astral-sh/ruff/releases/download/0.7.3/ruff-installer.ps1 | iex"
Download ruff 0.7.3
v0.7.2
Release Notes
Preview features
- Fix formatting of single with-item with trailing comment (#14005)
- [
pyupgrade
] Add PEP 646Unpack
conversion to*
with fix (UP044
) (#13988)
Rule changes
- Regenerate
known_stdlibs.rs
with stdlibs 2024.10.25 (#13963) - [
flake8-no-pep420
] Skip namespace package enforcement for PEP 723 scripts (INP001
) (#13974)
Server
- Fix server panic when undoing an edit (#14010)
Bug fixes
- Fix issues in discovering ruff in pip build environments (#13881)
- [
flake8-type-checking
] Fix false positive forsingledispatchmethod
(TCH003
) (#13941) - [
flake8-type-checking
] Treat return type ofsingledispatch
as runtime-required (TCH003
) (#13957)
Documentation
- [
flake8-simplify
] Include caveats of enablingif-else-block-instead-of-if-exp
(SIM108
) (#14019)
Install ruff 0.7.2
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.7.2/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -ExecutionPolicy ByPass -c "irm https://github.com/astral-sh/ruff/releases/download/0.7.2/ruff-installer.ps1 | iex"
Download ruff 0.7.2
v0.7.1
Release Notes
Preview features
- Fix
E221
andE222
to flag missing or extra whitespace around==
operator (#13890) - Formatter: Alternate quotes for strings inside f-strings in preview (#13860)
- Formatter: Join implicit concatenated strings when they fit on a line (#13663)
- [
pylint
] Restrictiteration-over-set
to only work on sets of literals (PLC0208
) (#13731)
Rule changes
- [
flake8-type-checking
] Support auto-quoting when annotations contain quotes (#11811)
Server
- Avoid indexing the workspace for single-file mode (#13770)
Bug fixes
- Make
ARG002
compatible withEM101
when raisingNotImplementedError
(#13714)
Other changes
- Introduce more Docker tags for Ruff (similar to uv) (#13274)
Contributors
- @Aditya-PS-05
- @AlexWaygood
- @Glyphack
- @Lexxxzy
- @MichaReiser
- @TomerBin
- @Watercycle
- @cake-monotone
- @carljm
- @dhruvmanila
- @diceroll123
- @mihaic
- @ndmitchell
- @pilleye
- @renovate
- @rtpg
- @samypr100
- @sharkdp
Install ruff 0.7.1
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.7.1/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -ExecutionPolicy ByPass -c "irm https://github.com/astral-sh/ruff/releases/download/0.7.1/ruff-installer.ps1 | iex"
Download ruff 0.7.1
v0.7.0
Release Notes
Check out the blog post for a migration guide and overview of the changes!
Breaking changes
- The pytest rules
PT001
andPT023
now default to omitting the decorator parentheses when there are no arguments (#12838, #13292). This was a change that we attempted to make in Ruff v0.6.0, but only partially made due to an error on our part. See the blog post for more details. - The
useless-try-except
rule (in ourtryceratops
category) has been recoded fromTRY302
toTRY203
(#13502). This ensures Ruff's code is consistent with the same rule in thetryceratops
linter. - The
lint.allow-unused-imports
setting has been removed (#13677). Uselint.pyflakes.allow-unused-imports
instead.
Formatter preview style
- Normalize implicit concatenated f-string quotes per part (#13539)
Preview linter features
- [
refurb
] implementhardcoded-string-charset
(FURB156) (#13530) - [
refurb
] Count codepoints not bytes forslice-to-remove-prefix-or-suffix (FURB188)
(#13631)
Rule changes
- [
pylint
] MarkPLE1141
fix as unsafe (#13629) - [
flake8-async
] Consider async generators to be "checkpoints" forcancel-scope-no-checkpoint
(ASYNC100
) (#13639) - [
flake8-bugbear
] Do not suggest setting parameterstrict=
toFalse
inB905
diagnostic message (#13656) - [
flake8-todos
] Only flag the word "TODO", not words starting with "todo" (TD006
) (#13640) - [
pycodestyle
] Fix whitespace-related false positives and false negatives inside type-parameter lists (E231
,E251
) (#13704) - [
flake8-simplify
] Stabilize preview behavior forSIM115
so that the rule can detect files being opened from a wider range of standard-library functions (#12959).
CLI
- Add explanation of fixable in
--statistics
command (#13774)
Bug fixes
- [
pyflakes
] Allowipytest
cell magic (F401
) (#13745) - [
flake8-use-pathlib
] FixPTH123
false positive whenopen
is passed a file descriptor (#13616) - [
flake8-bandit
] Detect patterns from multi line SQL statements (S608
) (#13574) - [
flake8-pyi
] - Fix dropped expressions inPYI030
autofix (#13727)
Contributors
- @AlexWaygood
- @DataEnggNerd
- @Lexxxzy
- @MichaReiser
- @Slyces
- @alex-700
- @autinerd
- @cake-monotone
- @carljm
- @dhruvmanila
- @diceroll123
- @dylwil3
- @github-actions
- @pilleye
- @qdegraaf
- @renovate
- @rtpg
- @sbrugman
- @sharkdp
- @zanieb
Install ruff 0.7.0
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.7.0/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -ExecutionPolicy ByPass -c "irm https://github.com/astral-sh/ruff/releases/download/0.7.0/ruff-installer.ps1 | iex"
Download ruff 0.7.0
v0.6.9
Release Notes
Preview features
- Fix codeblock dynamic line length calculation for indented docstring examples (#13523)
- [
refurb
] MarkFURB118
fix as unsafe (#13613)
Rule changes
- [
pydocstyle
] Don't raiseD208
when last line is non-empty (#13372) - [
pylint
] Preserve trivia (i.e. comments) inPLR5501
autofix (#13573)
Configuration
- [
pyflakes
] Addallow-unused-imports
setting forunused-import
rule (F401
) (#13601)
Bug fixes
- Support ruff discovery in pip build environments (#13591)
- [
flake8-bugbear
] Avoid short circuitingB017
for multiple context managers (#13609) - [
pylint
] Do not offer an invalid fix forPLR1716
when the comparisons contain parenthesis (#13527) - [
pyupgrade
] FixUP043
to apply tocollections.abc.Generator
andcollections.abc.AsyncGenerator
(#13611) - [
refurb
] Fix handling of slices in tuples forFURB118
, e.g.,x[:, 1]
(#13518)
Documentation
- Update GitHub Action link to
astral-sh/ruff-action
(#13551)
Install ruff 0.6.9
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.6.9/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -ExecutionPolicy ByPass -c "irm https://github.com/astral-sh/ruff/releases/download/0.6.9/ruff-installer.ps1 | iex"
Download ruff 0.6.9
v0.6.8
Release Notes
Preview features
- Remove unnecessary parentheses around
match case
clauses (#13510) - Parenthesize overlong
if
guards inmatch..case
clauses (#13513) - Detect basic wildcard imports in
ruff analyze graph
(#13486) - [
pylint
] Implementboolean-chained-comparison
(R1716
) (#13435)
Rule changes
- [
lake8-simplify
] DetectSIM910
when using variadic keyword arguments, i.e.,**kwargs
(#13503) - [
pyupgrade
] Avoid false negatives with non-reference shadowed bindings of loop variables (UP028
) (#13504)
Bug fixes
- Detect tuples bound to variadic positional arguments i.e.
*args
(#13512) - Exit gracefully on broken pipe errors (#13485)
- Avoid panic when analyze graph hits broken pipe (#13484)
Performance
Contributors
- @MichaReiser
- @TomerBin
- @charliermarsh
- @diceroll123
- @dylwil3
- @haarisr
- @renovate
- @sbrugman
- @vincevannoort
- @zanieb
Install ruff 0.6.8
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.6.8/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -ExecutionPolicy ByPass -c "irm https://github.com/astral-sh/ruff/releases/download/0.6.8/ruff-installer.ps1 | iex"
Download ruff 0.6.8
v0.6.7
Release Notes
Preview features
- Add Python version support to ruff analyze CLI (#13426)
- Add
exclude
support toruff analyze
(#13425) - Fix parentheses around return type annotations (#13381)
Rule changes
- [
pycodestyle
] Fix: Don't autofix if the first line ends in a question mark? (D400) (#13399)
Bug fixes
- Respect
lint.exclude
in ruff check--add-noqa
(#13427)
Performance
- Avoid tracking module resolver files in Salsa (#13437)
- Use
forget
for module resolver database (#13438)
Install ruff 0.6.7
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.6.7/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -ExecutionPolicy ByPass -c "irm https://github.com/astral-sh/ruff/releases/download/0.6.7/ruff-installer.ps1 | iex"
Download ruff 0.6.7
v0.6.6
Release Notes
Preview features
- [
refurb
] Skipslice-to-remove-prefix-or-suffix
(FURB188
) when non-trivial slice steps are present (#13405) - Add a subcommand to generate dependency graphs (#13402)
Formatter
- Fix placement of inline parameter comments (#13379)
Server
- Fix off-by one error in the
LineIndex::offset
calculation (#13407)
Bug fixes
- [
fastapi
] Respect FastAPI aliases in route definitions (#13394) - [
pydocstyle
] Respect word boundaries when detecting function signature in docs (#13388)
Documentation
- Add backlinks to rule overview linter (#13368)
- Fix documentation for editor vim plugin ALE (#13348)
- Fix rendering of
FURB188
docs (#13406)
Install ruff 0.6.6
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.6.6/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -c "irm https://github.com/astral-sh/ruff/releases/download/0.6.6/ruff-installer.ps1 | iex"
Download ruff 0.6.6
v0.6.5
Release Notes
Preview features
- [
pydoclint
] IgnoreDOC201
when function name is "new" (#13300) - [
refurb
] Implementslice-to-remove-prefix-or-suffix
(FURB188
) (#13256)
Rule changes
- [
eradicate
] Ignore script-comments with multiple end-tags (ERA001
) (#13283) - [
pyflakes
] Improve error message forUndefinedName
when a builtin was added in a newer version than specified in Ruff config (F821
) (#13293)
Server
- Add support for extensionless Python files for server (#13326)
- Fix configuration inheritance for configurations specified in the LSP settings (#13285)
Bug fixes
- [
ruff
] Handle unary operators indecimal-from-float-literal
(RUF032
) (#13275)
CLI
- Only include rules with diagnostics in SARIF metadata (#13268)
Playground
- Add "Copy as pyproject.toml/ruff.toml" and "Paste from TOML" (#13328)
- Fix errors not shown for restored snippet on page load (#13262)
Contributors
- @AlexWaygood
- @MichaReiser
- @RussellLuo
- @Slyces
- @augustelalande
- @calumy
- @carljm
- @dhruvmanila
- @dizzy57
- @dylwil3
- @renovate
Install ruff 0.6.5
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.6.5/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -c "irm https://github.com/astral-sh/ruff/releases/download/0.6.5/ruff-installer.ps1 | iex"
Download ruff 0.6.5
v0.6.4
Release Notes
Preview features
- [
flake8-builtins
] Use dynamic builtins list based on Python version (#13172) - [
pydoclint
] Permit yieldingNone
inDOC402
andDOC403
(#13148) - [
pylint
] Update diagnostic message forPLW3201
(#13194) - [
ruff
] Implementpost-init-default
(RUF033
) (#13192) - [
ruff
] Implement useless if-else (RUF034
) (#13218)
Rule changes
- [
flake8-pyi
] Respectpep8_naming.classmethod-decorators
settings when determining if a method is a classmethod incustom-type-var-return-type
(PYI019
) (#13162) - [
flake8-pyi
] Teach various rules that annotations might be stringized (#12951) - [
pylint
] Avoidno-self-use
forattrs
-style validators (#13166) - [
pylint
] Recurse into subscript subexpressions when searching for list/dict lookups (PLR1733
,PLR1736
) (#13186) - [
pyupgrade
] Detectaiofiles.open
calls inUP015
(#13173) - [
pyupgrade
] Marksys.version_info[0] < 3
and similar comparisons as outdated (UP036
) (#13175)
CLI
- Enrich messages of SARIF results (#13180)
- Handle singular case for incompatible rules warning in
ruff format
output (#13212)
Bug fixes
- [
pydocstyle
] Improve heuristics for detecting Google-style docstrings (#13142) - [
refurb
] Treatsep
arguments with effects as unsafe removals (FURB105
) (#13165)
Contributors
- @AlexWaygood
- @Jinior
- @MichaReiser
- @RubenVanEldik
- @RussellLuo
- @Slyces
- @carljm
- @charliermarsh
- @chriskrycho
- @dhruvmanila
- @dylwil3
- @github-actions
- @iamlucasvieira
- @jamesbraza
- @renovate
- @tjkuson
- @zhoufanjin
Install ruff 0.6.4
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.6.4/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -c "irm https://github.com/astral-sh/ruff/releases/download/0.6.4/ruff-installer.ps1 | iex"
Download ruff 0.6.4
v0.6.3
Release Notes
Preview features
- [
flake8-simplify
] Extendopen-file-with-context-handler
to work withdbm.sqlite3
(SIM115
) (#13104) - [
pycodestyle
] DisableE741
in stub files (.pyi
) (#13119) - [
pydoclint
] AvoidDOC201
on explicit returns in functions that only returnNone
(#13064)
Rule changes
- [
flake8-async
] Disable check forasyncio
before Python 3.11 (ASYNC109
) (#13023)
Bug fixes
- [
FastAPI
] Avoid introducing invalid syntax in fix forfast-api-non-annotated-dependency
(FAST002
) (#13133) - [
flake8-implicit-str-concat
] Normalize octals before merging concatenated strings insingle-line-implicit-string-concatenation
(ISC001
) (#13118) - [
flake8-pytest-style
] Improve help message forpytest-incorrect-mark-parentheses-style
(PT023
) (#13092) - [
pylint
] Avoid autofix for calls that aren'tmin
ormax
as starred expression (PLW3301
) (#13089) - [
ruff
] Adddatetime.time
,datetime.tzinfo
, anddatetime.timezone
as immutable function calls (RUF009
) (#13109) - [
ruff
] Extend comment deletion forRUF100
to include trailing text fromnoqa
directives while preserving any following comments on the same line, if any (#13105) - Fix dark theme on initial page load for the Ruff playground (#13077)
Contributors
- @AlexWaygood
- @JonathanPlasse
- @MichaReiser
- @N-Wouda
- @PalAditya
- @arkuhn
- @calumy
- @carljm
- @chriskrycho
- @dhruvmanila
- @diceroll123
- @dylwil3
- @renovate
- @teofr
- @tjkuson
- @vdwees
Install ruff 0.6.3
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.6.3/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -c "irm https://github.com/astral-sh/ruff/releases/download/0.6.3/ruff-installer.ps1 | iex"
Download ruff 0.6.3
v0.6.2
Release Notes
Preview features
- [
flake8-simplify
] Extendopen-file-with-context-handler
to work with other standard-library IO modules (SIM115
) (#12959) - [
ruff
] Avoidunused-async
for functions with FastAPI route decorator (RUF029
) (#12938) - [
ruff
] Ignorefstring-missing-syntax
(RUF027
) forfastAPI
paths (#12939) - [
ruff
] Implement check for Decimal called with a float literal (RUF032) (#12909)
Rule changes
- [
flake8-bugbear
] Update diagnostic message when expression is at the end of function (B015
) (#12944) - [
flake8-pyi
] Skip type annotations instring-or-bytes-too-long
(PYI053
) (#13002) - [
flake8-type-checking
] Always recognise relative imports as first-party (#12994) - [
flake8-unused-arguments
] Ignore unused arguments on stub functions (ARG001
) (#12966) - [
pylint
] Ignore augmented assignment forself-cls-assignment
(PLW0642
) (#12957)
Server
- Show full context in error log messages (#13029)
Bug fixes
- [
pep8-naming
] Don't flagfrom
imports following conventional import names (N817
) (#12946) - [
pylint
] - Allow__new__
methods to havecls
as their first argument even if decorated with@staticmethod
forbad-staticmethod-argument
(PLW0211
) (#12958)
Documentation
- Add
hyperfine
installation instructions; updatehyperfine
code samples (#13034) - Expand note to use Ruff with other language server in Kate (#12806)
- Update example for
PT001
as per the new default behavior (#13019) - [
perflint
] Improve docs fortry-except-in-loop
(PERF203
) (#12947) - [
pydocstyle
] Add reference tolint.pydocstyle.ignore-decorators
setting to rule docs (#12996)
Contributors
- @AlexWaygood
- @FinchPowers
- @InSyncWithFoo
- @MichaReiser
- @Skylion007
- @TomerBin
- @carljm
- @charliermarsh
- @dhruvmanila
- @diceroll123
- @dsal3389
- @dylwil3
- @kbaskett248
- @lengau
- @mkniewallner
- @olp-cs
- @renovate
- @tfardet
Install ruff 0.6.2
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.6.2/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -c "irm https://github.com/astral-sh/ruff/releases/download/0.6.2/ruff-installer.ps1 | iex"
Download ruff 0.6.2
v0.6.1
Release Notes
This is a hotfix release to address an issue with ruff-pre-commit
. In v0.6, Ruff changed its behavior to lint and format Jupyter notebooks by default; however, due to an oversight, these files were still excluded by default if Ruff was run via pre-commit, leading to inconsistent behavior. This has now been fixed.
Preview features
- [
fastapi
] Implementfast-api-unused-path-parameter
(FAST003
) (#12638)
Rule changes
- [
pylint
] Renametoo-many-positional
totoo-many-positional-arguments
(R0917
) (#12905)
Server
- Fix crash when applying "fix-all" code-action to notebook cells (#12929)
Other changes
- [
flake8-naming
]: Respect import conventions (N817
) (#12922)
Contributors
Install ruff 0.6.1
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.6.1/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -c "irm https://github.com/astral-sh/ruff/releases/download/0.6.1/ruff-installer.ps1 | iex"
Download ruff 0.6.1
v0.6.0
Release Notes
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.
- Lint and format Jupyter Notebook by default (#12878).
- Detect imports in
src
layouts by default forisort
rules (#12848) - The pytest rules
PT001
andPT023
now default to omitting the decorator parentheses when there are no arguments (#12838).
Deprecations
The following rules are now deprecated:
-
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:
-
unnecessary-dict-comprehension-for-iterable
:RUF025
toC420
Stabilization
The following rules have been stabilized and are no longer in preview:
-
singledispatch-method
(PLE1519
) -
singledispatchmethod-function
(PLE1520
) -
bad-staticmethod-argument
(PLW0211
) -
if-stmt-min-max
(PLR1730
) -
invalid-bytes-return-type
(PLE0308
) -
invalid-hash-return-type
(PLE0309
) -
invalid-index-return-type
(PLE0305
) -
invalid-length-return-type
(E303
) -
self-or-cls-assignment
(PLW0642
) -
byte-string-usage
(PYI057
) -
duplicate-literal-member
(PYI062
) -
redirected-noqa
(RUF101
)
The following behaviors have been stabilized:
-
cancel-scope-no-checkpoint
(ASYNC100
): Supportasyncio
andanyio
context mangers. -
async-function-with-timeout
(ASYNC109
): Supportasyncio
andanyio
context mangers. -
async-busy-wait
(ASYNC110
): Supportasyncio
andanyio
context mangers. -
async-zero-sleep
(ASYNC115
): Supportanyio
context mangers. -
long-sleep-not-forever
(ASYNC116
): Supportanyio
context mangers.
The following fixes have been stabilized:
-
superfluous-else-return
(RET505
) -
superfluous-else-raise
(RET506
) -
superfluous-else-continue
(RET507
) -
superfluous-else-break
(RET508
)
Preview features
- [
flake8-simplify
] Further simplify to binary in preview for (SIM108
) (#12796) - [
pyupgrade
] Show violations without auto-fix (UP031
) (#11229)
Rule changes
- [
flake8-import-conventions
] Addxml.etree.ElementTree
to default conventions (#12455) - [
flake8-pytest-style
] Add a space after comma in CSV output (PT006
) (#12853)
Server
- Show a message for incorrect settings (#12781)
Bug fixes
- [
flake8-async
] Do not lint yield in context manager (ASYNC100
) (#12896) - [
flake8-comprehensions
] Do not lintasync for
comprehensions (C419
) (#12895) - [
flake8-return
] Only add returnNone
at end of a function (RET503
) (#11074) - [
flake8-type-checking
] Avoid treatingdataclasses.KW_ONLY
as typing-only (TCH003
) (#12863) - [
pep8-naming
] Treattype(Protocol)
et al as metaclass base (N805
) (#12770) - [
pydoclint
] Don't enforce returns and yields in abstract methods (DOC201
,DOC202
) (#12771) - [
ruff
] Skip tuples with slice expressions in (RUF031
) (#12768) - [
ruff
] Ignore unparenthesized tuples in subscripts when the subscript is a type annotation or type alias (RUF031
) (#12762) - [
ruff
] Ignore template strings passed to logging andbuiltins._()
calls (RUF027
) (#12889) - [
ruff
] Do not remove parens for tuples with starred expressions in Python <=3.10 (RUF031
) (#12784) - Evaluate default parameter values for a function in that function's enclosing scope (#12852)
Other changes
- Respect VS Code cell metadata when detecting the language of Jupyter Notebook cells (#12864)
- Respect
kernelspec
notebook metadata when detecting the preferred language for a Jupyter Notebook (#12875)
Install ruff 0.6.0
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.6.0/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -c "irm https://github.com/astral-sh/ruff/releases/download/0.6.0/ruff-installer.ps1 | iex"
Download ruff 0.6.0
v0.5.7
Release Notes
Preview features
- [
flake8-comprehensions
] Account for list and set comprehensions inunnecessary-literal-within-tuple-call
(C409
) (#12657) - [
flake8-pyi
] Add autofix forfuture-annotations-in-stub
(PYI044
) (#12676) - [
flake8-return
] Avoid syntax error when auto-fixingRET505
with mixed indentation (space and tabs) (#12740) - [
pydoclint
] Adddocstring-missing-yields
(DOC402
) anddocstring-extraneous-yields
(DOC403
) (#12538) - [
pydoclint
] AvoidDOC201
if docstring begins with "Return", "Returns", "Yield", or "Yields" (#12675) - [
pydoclint
] Deduplicate collected exceptions after traversing function bodies (DOC501
) (#12642) - [
pydoclint
] IgnoreDOC
errors for stub functions (#12651) - [
pydoclint
] Teach rules to understand reraised exceptions as being explicitly raised (DOC501
,DOC502
) (#12639) - [
ruff
] Implementincorrectly-parenthesized-tuple-in-subscript
(RUF031
) (#12480) - [
ruff
] MarkRUF023
fix as unsafe if__slots__
is not a set and the binding is used elsewhere (#12692)
Rule changes
- [
refurb
] Add autofix forimplicit-cwd
(FURB177
) (#12708) - [
ruff
] Add autofix forzip-instead-of-pairwise
(RUF007
) (#12663) - [
tryceratops
] AddBaseException
toraise-vanilla-class
rule (TRY002
) (#12620)
Server
- Ignore non-file workspace URL; Ruff will display a warning notification in this case (#12725)
CLI
- Fix cache invalidation for nested
pyproject.toml
files (#12727)
Bug fixes
- [
flake8-async
] Fix false positives with multipleasync with
items (ASYNC100
) (#12643) - [
flake8-bandit
] Avoid false-positives for list concatenations in SQL construction (S608
) (#12720) - [
flake8-bugbear
] Treatreturn
as equivalent tobreak
(B909
) (#12646) - [
flake8-comprehensions
] Set comprehensions not a violation forsum
inunnecessary-comprehension-in-call
(C419
) (#12691) - [
flake8-simplify
] Parenthesize conditions based on precedence when merging if arms (SIM114
) (#12737) - [
pydoclint
] Try both 'Raises' section styles when convention is unspecified (DOC501
) (#12649)
Contributors
- @AlexWaygood
- @DavideRagazzon
- @InSyncWithFoo
- @MichaReiser
- @augustelalande
- @bluetech
- @carljm
- @cclauss
- @charliermarsh
- @dhruvmanila
- @diceroll123
- @dylwil3
- @ember91
- @epenet
- @renovate
Install ruff 0.5.7
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.5.7/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -c "irm https://github.com/astral-sh/ruff/releases/download/0.5.7/ruff-installer.ps1 | iex"
Download ruff 0.5.7
v0.5.6
Release Notes
Ruff 0.5.6 automatically enables linting and formatting of notebooks in preview mode.
You can opt-out of this behavior by adding *.ipynb
to the extend-exclude
setting.
[tool.ruff]
extend-exclude = ["*.ipynb"]
Preview features
- Enable notebooks by default in preview mode (#12621)
- [
flake8-builtins
] Implement import, lambda, and module shadowing (#12546) - [
pydoclint
] Adddocstring-missing-returns
(DOC201
) anddocstring-extraneous-returns
(DOC202
) (#12485)
Rule changes
- [
flake8-return
] Exempt cached properties and other property-like decorators from explicit return rule (RET501
) (#12563)
Server
- Make server panic hook more error resilient (#12610)
- Use
$/logTrace
for server trace logs in Zed and VS Code (#12564) - Keep track of deleted cells for reorder change request (#12575)
Configuration
- [
flake8-implicit-str-concat
] Always allow explicit multi-line concatenations when implicit concatenations are banned (#12532)
Bug fixes
- [
flake8-async
] Avoid flaggingasyncio.timeout
s as unused when the context manager includesasyncio.TaskGroup
(#12605) - [
flake8-slots
] Avoid recommending__slots__
for classes that inherit from more thannamedtuple
(#12531) - [
isort
] Avoid marking required imports as unused (#12537) - [
isort
] Preserve trailing inline comments on import-from statements (#12498) - [
pycodestyle
] Add newlines before comments (E305
) (#12606) - [
pycodestyle
] Don't attach comments with mismatched indents (#12604) - [
pyflakes
] Fix preview-mode bugs inF401
when attempting to autofix unused first-party submodule imports in an__init__.py
file (#12569) - [
pylint
] Respect start index inunnecessary-list-index-lookup
(#12603) - [
pyupgrade
] Avoid recommending no-argument super inslots=True
dataclasses (#12530) - [
pyupgrade
] Use colon rather than dot formatting for integer-only types (#12534) - Fix NFKC normalization bug when removing unused imports (#12571)
Other changes
- Consider more stdlib decorators to be property-like (#12583)
- Improve handling of metaclasses in various linter rules (#12579)
- Improve consistency between linter rules in determining whether a function is property (#12581)
Install ruff 0.5.6
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.5.6/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -c "irm https://github.com/astral-sh/ruff/releases/download/0.5.6/ruff-installer.ps1 | iex"
Download ruff 0.5.6
v0.5.5
Release Notes
Preview features
- [
fastapi
] Implementfastapi-redundant-response-model
(FAST001
) andfastapi-non-annotated-dependency
(FAST002
) (#11579) - [
pydoclint
] Implementdocstring-missing-exception
(DOC501
) anddocstring-extraneous-exception
(DOC502
) (#11471)
Rule changes
- [
numpy
] Fix NumPy 2.0 rule fornp.alltrue
andnp.sometrue
(#12473) - [
numpy
] IgnoreNPY201
insideexcept
blocks for compatibility with older numpy versions (#12490) - [
pep8-naming
] Avoid applyingignore-names
toself
andcls
function names (N804
,N805
) (#12497)
Formatter
- Fix incorrect placement of leading function comment with type params (#12447)
Server
- Do not bail code action resolution when a quick fix is requested (#12462)
Bug fixes
- Fix
Ord
implementation ofcmp_fix
(#12471) - Raise syntax error for unparenthesized generator expression in multi-argument call (#12445)
- [
pydoclint
] Fix panic inDOC501
reported in #12428 (#12435) - [
flake8-bugbear
] Allow singleton tuples with starred expressions inB013
(#12484)
Documentation
- Add Eglot setup guide for Emacs editor (#12426)
- Add note about the breaking change in
nvim-lspconfig
(#12507) - Add note to include notebook files for native server (#12449)
- Add setup docs for Zed editor (#12501)
Contributors
- @AlexWaygood
- @IvanIsCoding
- @MichaReiser
- @TomerBin
- @UriyaHarpeness
- @augustelalande
- @carljm
- @charliermarsh
- @dhruvmanila
- @dylwil3
- @foxmean
- @mtsokol
- @osiewicz
- @renovate
- @thejcannon
Install ruff 0.5.5
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.5.5/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -c "irm https://github.com/astral-sh/ruff/releases/download/0.5.5/ruff-installer.ps1 | iex"
Download ruff 0.5.5
v0.5.4
Release Notes
Rule changes
- [
ruff
] RenameRUF007
tozip-instead-of-pairwise
(#12399)
Bug fixes
- [
flake8-builtins
] Avoid shadowing diagnostics for@override
methods (#12415) - [
flake8-comprehensions
] Insert parentheses for multi-argument generators (#12422) - [
pydocstyle
] Handle escaped docstrings within docstring (D301
) (#12192)
Documentation
Install ruff 0.5.4
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.5.4/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -c "irm https://github.com/astral-sh/ruff/releases/download/0.5.4/ruff-installer.ps1 | iex"
Download ruff 0.5.4
v0.5.3
Release Notes
Ruff 0.5.3 marks the stable release of the Ruff language server and introduces revamped documentation, including setup guides for your editor of choice and the language server itself.
Preview features
- Formatter: Insert empty line between suite and alternative branch after function/class definition (#12294)
- [
pyupgrade
] Implementunnecessary-default-type-args
(UP043
) (#12371)
Rule changes
- [
flake8-bugbear
] Detect enumerate iterations inloop-iterator-mutation
(B909
) (#12366) - [
flake8-bugbear
] Removediscard
,remove
, andpop
allowance forloop-iterator-mutation
(B909
) (#12365) - [
pylint
] Allowrepeated-equality-comparison
for mixed operations (PLR1714
) (#12369) - [
pylint
] Ignoreself
andcls
when counting arguments (PLR0913
) (#12367) - [
pylint
] Use UTF-8 as default encoding inunspecified-encoding
fix (PLW1514
) (#12370)
Server
- Build settings index in parallel for the native server (#12299)
- Use fallback settings when indexing the project (#12362)
- Consider
--preview
flag forserver
subcommand for the linter and formatter (#12208)
Bug fixes
- [
flake8-comprehensions
] Allow additional arguments forsum
andmax
comprehensions (C419
) (#12364) - [
pylint
] Avoid dropping extra boolean operations inrepeated-equality-comparison
(PLR1714
) (#12368) - [
pylint
] Consider expression before statement when determining binding kind (PLR1704
) (#12346)
Documentation
- Add docs for Ruff language server (#12344)
- Migrate to standalone docs repo (#12341)
- Update versioning policy for editor integration (#12375)
Other changes
- Publish Wasm API to npm (#12317)
Contributors
- @AlexWaygood
- @MichaReiser
- @cake-monotone
- @carljm
- @charliermarsh
- @dhruvmanila
- @github-actions
- @konstin
- @mattrunyon
- @renovate
Install ruff 0.5.3
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.5.3/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -c "irm https://github.com/astral-sh/ruff/releases/download/0.5.3/ruff-installer.ps1 | iex"
Download ruff 0.5.3
v0.5.2
Release Notes
Preview features
- Use
space
separator before parenthesized expressions in comprehensions with leading comments (#12282) - [
flake8-async
] UpdateASYNC100
to includeanyio
andasyncio
(#12221) - [
flake8-async
] UpdateASYNC109
to includeanyio
andasyncio
(#12236) - [
flake8-async
] UpdateASYNC110
to includeanyio
andasyncio
(#12261) - [
flake8-async
] UpdateASYNC115
to includeanyio
andasyncio
(#12262) - [
flake8-async
] UpdateASYNC116
to includeanyio
andasyncio
(#12266)
Rule changes
- [
flake8-return
] Exempt properties from explicit return rule (RET501
) (#12243) - [
numpy
] Addnp.NAN
-to-np.nan
diagnostic (#12292) - [
refurb
] Makelist-reverse-copy
an unsafe fix (#12303)
Server
- Consider
include
andextend-include
settings in native server (#12252) - Include nested configurations in settings reloading (#12253)
CLI
- Omit code frames for fixes with empty ranges (#12304)
- Warn about formatter incompatibility for
D203
(#12238)
Bug fixes
- Make cache-write failures non-fatal on Windows (#12302)
- Treat
not
operations as boolean tests (#12301) - [
flake8-bandit
] AvoidS310
violations for HTTP-safe f-strings (#12305) - [
flake8-bandit
] Support explicit string concatenations in S310 HTTP detection (#12315) - [
flake8-bandit
] fix S113 false positive for httpx withouttimeout
argument (#12213) - [
pycodestyle
] Remove "non-obvious" allowance for E721 (#12300) - [
pyflakes
] Considerwith
blocks as single-item branches for redefinition analysis (#12311) - [
refurb
] Restrict forwarding fornewline
argument inopen()
calls to Python versions >= 3.10 (#12244)
Documentation
- Update help and documentation to reflect
--output-format full
default (#12248)
Performance
- Use more threads when discovering Python files (#12258)
Install ruff 0.5.2
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.5.2/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -c "irm https://github.com/astral-sh/ruff/releases/download/0.5.2/ruff-installer.ps1 | iex"
Download ruff 0.5.2
v0.5.1
Release Notes
Preview features
- [
flake8-bugbear
] Implement mutable-contextvar-default (B039) (#12113) - [
pycodestyle
] Whitespace after decorator (E204
) (#12140) - [
pytest
] ReversePT001
andPT0023
defaults (#12106)
Rule changes
- Enable token-based rules on source with syntax errors (#11950)
- [
flake8-bandit
] Detecthttpx
forS113
(#12174) - [
numpy
] UpdateNPY201
to include exception deprecations (#12065) - [
pylint
] Generate autofix forduplicate-bases
(PLE0241
) (#12105)
Server
- Avoid syntax error notification for source code actions (#12148)
- Consider the content of the new cells during notebook sync (#12203)
- Fix replacement edit range computation (#12171)
Bug fixes
- Disable auto-fix when source has syntax errors (#12134)
- Fix cache key collisions for paths with separators (#12159)
- Make
requires-python
inference robust to==
(#12091) - Use char-wise width instead of
str
-width (#12135) - [
pycodestyle
] AvoidE275
if keyword followed by comma (#12136) - [
pycodestyle
] AvoidE275
if keyword is followed by a semicolon (#12095) - [
pylint
] Skip dummy variables forPLR1704
(#12190)
Performance
Contributors
- @AlexWaygood
- @MichaReiser
- @Peiffap
- @ThomasFaivre
- @bersace
- @charliermarsh
- @dhruvmanila
- @github-actions
- @jkauerl
- @mkniewallner
- @mtsokol
- @renovate
- @snowsignal
- @tjkuson
- @zanieb
Install ruff 0.5.1
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.5.1/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -c "irm https://github.com/astral-sh/ruff/releases/download/0.5.1/ruff-installer.ps1 | iex"
Download ruff 0.5.1
v0.5.0
Release Notes
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.
- Follow the XDG specification to discover user-level configurations on macOS (same as on other Unix platforms)
- Selecting
ALL
now excludes deprecated rules - The released archives now include an extra level of nesting, which can be removed with
--strip-components=1
when untarring. - The release artifact's file name no longer includes the version tag. This enables users to install via
/latest
URLs on GitHub. - The diagnostic ranges for some
flake8-bandit
rules were modified (#10667).
Deprecations
The following rules are now deprecated:
-
syntax-error
(E999
): Syntax errors are now always shown
Remapped rules
The following rules have been remapped to new rule codes:
-
blocking-http-call-in-async-function
:ASYNC100
toASYNC210
-
open-sleep-or-subprocess-in-async-function
:ASYNC101
split intoASYNC220
,ASYNC221
,ASYNC230
, andASYNC251
-
blocking-os-call-in-async-function
:ASYNC102
has been merged intoASYNC220
andASYNC221
-
trio-timeout-without-await
:TRIO100
toASYNC100
-
trio-sync-call
:TRIO105
toASYNC105
-
trio-async-function-with-timeout
:TRIO109
toASYNC109
-
trio-unneeded-sleep
:TRIO110
toASYNC110
-
trio-zero-sleep-call
:TRIO115
toASYNC115
-
repeated-isinstance-calls
:PLR1701
toSIM101
Stabilization
The following rules have been stabilized and are no longer in preview:
-
mutable-fromkeys-value
(RUF024
) -
default-factory-kwarg
(RUF026
) -
django-extra
(S610
) -
manual-dict-comprehension
(PERF403
) -
print-empty-string
(FURB105
) -
readlines-in-for
(FURB129
) -
if-expr-min-max
(FURB136
) -
bit-count
(FURB161
) -
redundant-log-base
(FURB163
) -
regex-flag-alias
(FURB167
) -
isinstance-type-none
(FURB168
) -
type-none-comparison
(FURB169
) -
implicit-cwd
(FURB177
) -
hashlib-digest-hex
(FURB181
) -
list-reverse-copy
(FURB187
) -
bad-open-mode
(PLW1501
) -
empty-comment
(PLR2044
) -
global-at-module-level
(PLW0604
) -
misplaced-bare-raise
(PLE0744
) -
non-ascii-import-name
(PLC2403
) -
non-ascii-name
(PLC2401
) -
nonlocal-and-global
(PLE0115
) -
potential-index-error
(PLE0643
) -
redeclared-assigned-name
(PLW0128
) -
redefined-argument-from-local
(PLR1704
) -
repeated-keyword-argument
(PLE1132
) -
super-without-brackets
(PLW0245
) -
unnecessary-list-index-lookup
(PLR1736
) -
useless-exception-statement
(PLW0133
) -
useless-with-lock
(PLW2101
)
The following behaviors have been stabilized:
-
is-literal
(F632
) now warns for identity checks against list, set or dictionary literals -
needless-bool
(SIM103
) now detectsif
expressions with implicitelse
branches -
module-import-not-at-top-of-file
(E402
) now allowsos.environ
modifications between import statements -
type-comparison
(E721
) now allows idioms such astype(x) is int
-
yoda-condition
(SIM300
) now flags a wider range of expressions
Removals
The following deprecated settings have been removed:
-
output-format=text
; useoutput-format=concise
oroutput-format=full
-
tab-size
; useindent-width
The following deprecated CLI options have been removed:
-
--show-source
; use--output-format=full
-
--no-show-source
; use--output-format=concise
The following deprecated CLI commands have been removed:
-
ruff <path>
; useruff check <path>
-
ruff --clean
; useruff clean
-
ruff --generate-shell-completion
; useruff generate-shell-completion
Preview features
- [
ruff
] Addassert-with-print-message
rule (#11981)
CLI
- Use rule name rather than message in
--statistics
(#11697) - Use the output format
full
by default (#12010) - Don't log syntax errors to the console (#11902)
Rule changes
- [
ruff
] Fix false positives ifgettext
is imported using an alias (RUF027
) (#12025) - [
numpy
] Updatetrapz
andin1d
deprecation (NPY201
) (#11948) - [
flake8-bandit
] Modify diagnostic ranges for shell-related rules (#10667)
Server
- Closing an untitled, unsaved notebook document no longer throws an error (#11942)
- Support the usage of tildes and environment variables in
logFile
(#11945) - Add option to configure whether to show syntax errors (#12059)
Bug fixes
- [
pycodestyle
] AvoidE203
for f-string debug expression (#12024) - [
pep8-naming
] Match import-name ignores against both name and alias (N812
,N817
) (#12033) - [
pyflakes
] Detect assignments that shadow definitions (F811
) (#11961)
Parser
- Emit a syntax error for an empty type parameter list (#12030)
- Avoid consuming the newline for unterminated strings (#12067)
- Do not include the newline in the unterminated string range (#12017)
- Use the correct range to highlight line continuation errors (#12016)
- Consider 2-character EOL before line continuations (#12035)
- Consider line continuation character for re-lexing (#12008)
Other changes
- Upgrade the Unicode table used for measuring the line-length (#11194)
- Remove the deprecation error message for the nursery selector (#10172)
Contributors
- @AlexWaygood
- @MichaReiser
- @Peiffap
- @R1kaB3rN
- @baggiponte
- @charliermarsh
- @dedebenui
- @denwong47
- @dhruvmanila
- @ericbn
- @relausen
- @renovate
- @snowsignal
- @ukyen8
- @wyardley
- @tibor-reiss
- @T-256
- @WindowGenerator
- @augustelalande
Install ruff 0.5.0
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.5.0/ruff-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -c "irm https://github.com/astral-sh/ruff/releases/download/0.5.0/ruff-installer.ps1 | iex"
Download ruff 0.5.0
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever MR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this MR and you won't be reminded about this update again.
- [ ] If you want to rebase/retry this MR, check this box
This MR has been generated by Renovate Bot.
Merge request reports
Activity
mentioned in issue #1
added 3 commits
-
5b59e51d...9733d245 - 2 commits from branch
master
- 47c7210c - Update dependency ruff to ^0.12.0
-
5b59e51d...9733d245 - 2 commits from branch