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"