Ruff

Latest version: v0.8.6

Safety actively analyzes 693883 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 18 of 28

0.5.6

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.

toml
[tool.ruff]
extend-exclude = ["*.ipynb"]


Preview features

- Enable notebooks by default in preview mode ([12621](https://github.com/astral-sh/ruff/pull/12621))
- \[`flake8-builtins`\] Implement import, lambda, and module shadowing ([12546](https://github.com/astral-sh/ruff/pull/12546))
- \[`pydoclint`\] Add `docstring-missing-returns` (`DOC201`) and `docstring-extraneous-returns` (`DOC202`) ([12485](https://github.com/astral-sh/ruff/pull/12485))

Rule changes

- \[`flake8-return`\] Exempt cached properties and other property-like decorators from explicit return rule (`RET501`) ([12563](https://github.com/astral-sh/ruff/pull/12563))

Server

- Make server panic hook more error resilient ([12610](https://github.com/astral-sh/ruff/pull/12610))
- Use `$/logTrace` for server trace logs in Zed and VS Code ([12564](https://github.com/astral-sh/ruff/pull/12564))
- Keep track of deleted cells for reorder change request ([12575](https://github.com/astral-sh/ruff/pull/12575))

Configuration

- \[`flake8-implicit-str-concat`\] Always allow explicit multi-line concatenations when implicit concatenations are banned ([12532](https://github.com/astral-sh/ruff/pull/12532))

Bug fixes

- \[`flake8-async`\] Avoid flagging `asyncio.timeout`s as unused when the context manager includes `asyncio.TaskGroup` ([12605](https://github.com/astral-sh/ruff/pull/12605))
- \[`flake8-slots`\] Avoid recommending `__slots__` for classes that inherit from more than `namedtuple` ([12531](https://github.com/astral-sh/ruff/pull/12531))
- \[`isort`\] Avoid marking required imports as unused ([12537](https://github.com/astral-sh/ruff/pull/12537))
- \[`isort`\] Preserve trailing inline comments on import-from statements ([12498](https://github.com/astral-sh/ruff/pull/12498))
- \[`pycodestyle`\] Add newlines before comments (`E305`) ([12606](https://github.com/astral-sh/ruff/pull/12606))
- \[`pycodestyle`\] Don't attach comments with mismatched indents ([12604](https://github.com/astral-sh/ruff/pull/12604))
- \[`pyflakes`\] Fix preview-mode bugs in `F401` when attempting to autofix unused first-party submodule imports in an `__init__.py` file ([12569](https://github.com/astral-sh/ruff/pull/12569))
- \[`pylint`\] Respect start index in `unnecessary-list-index-lookup` ([12603](https://github.com/astral-sh/ruff/pull/12603))
- \[`pyupgrade`\] Avoid recommending no-argument super in `slots=True` dataclasses ([12530](https://github.com/astral-sh/ruff/pull/12530))
- \[`pyupgrade`\] Use colon rather than dot formatting for integer-only types ([12534](https://github.com/astral-sh/ruff/pull/12534))
- Fix NFKC normalization bug when removing unused imports ([12571](https://github.com/astral-sh/ruff/pull/12571))

Other changes

- Consider more stdlib decorators to be property-like ([12583](https://github.com/astral-sh/ruff/pull/12583))
- Improve handling of metaclasses in various linter rules ([12579](https://github.com/astral-sh/ruff/pull/12579))
- Improve consistency between linter rules in determining whether a function is property ([12581](https://github.com/astral-sh/ruff/pull/12581))

0.5.5

Preview features

- \[`fastapi`\] Implement `fastapi-redundant-response-model` (`FAST001`) and `fastapi-non-annotated-dependency`(`FAST002`) ([11579](https://github.com/astral-sh/ruff/pull/11579))
- \[`pydoclint`\] Implement `docstring-missing-exception` (`DOC501`) and `docstring-extraneous-exception` (`DOC502`) ([11471](https://github.com/astral-sh/ruff/pull/11471))

Rule changes

- \[`numpy`\] Fix NumPy 2.0 rule for `np.alltrue` and `np.sometrue` ([12473](https://github.com/astral-sh/ruff/pull/12473))
- \[`numpy`\] Ignore `NPY201` inside `except` blocks for compatibility with older numpy versions ([12490](https://github.com/astral-sh/ruff/pull/12490))
- \[`pep8-naming`\] Avoid applying `ignore-names` to `self` and `cls` function names (`N804`, `N805`) ([12497](https://github.com/astral-sh/ruff/pull/12497))

Formatter

- Fix incorrect placement of leading function comment with type params ([12447](https://github.com/astral-sh/ruff/pull/12447))

Server

- Do not bail code action resolution when a quick fix is requested ([12462](https://github.com/astral-sh/ruff/pull/12462))

Bug fixes

- Fix `Ord` implementation of `cmp_fix` ([12471](https://github.com/astral-sh/ruff/pull/12471))
- Raise syntax error for unparenthesized generator expression in multi-argument call ([12445](https://github.com/astral-sh/ruff/pull/12445))
- \[`pydoclint`\] Fix panic in `DOC501` reported in [12428](https://github.com/astral-sh/ruff/pull/12428) ([#12435](https://github.com/astral-sh/ruff/pull/12435))
- \[`flake8-bugbear`\] Allow singleton tuples with starred expressions in `B013` ([12484](https://github.com/astral-sh/ruff/pull/12484))

Documentation

- Add Eglot setup guide for Emacs editor ([12426](https://github.com/astral-sh/ruff/pull/12426))
- Add note about the breaking change in `nvim-lspconfig` ([12507](https://github.com/astral-sh/ruff/pull/12507))
- Add note to include notebook files for native server ([12449](https://github.com/astral-sh/ruff/pull/12449))
- Add setup docs for Zed editor ([12501](https://github.com/astral-sh/ruff/pull/12501))

0.5.4

Rule changes

- \[`ruff`\] Rename `RUF007` to `zip-instead-of-pairwise` ([12399](https://github.com/astral-sh/ruff/pull/12399))

Bug fixes

- \[`flake8-builtins`\] Avoid shadowing diagnostics for `override` methods ([12415](https://github.com/astral-sh/ruff/pull/12415))
- \[`flake8-comprehensions`\] Insert parentheses for multi-argument generators ([12422](https://github.com/astral-sh/ruff/pull/12422))
- \[`pydocstyle`\] Handle escaped docstrings within docstring (`D301`) ([12192](https://github.com/astral-sh/ruff/pull/12192))

Documentation

- Fix GitHub link to Neovim setup ([12410](https://github.com/astral-sh/ruff/pull/12410))
- Fix `output-format` default in settings reference ([12409](https://github.com/astral-sh/ruff/pull/12409))

0.5.3

[documentation](https://docs.astral.sh/ruff/editors), including [setup guides for your editor of
choice](https://docs.astral.sh/ruff/editors/setup) and [the language server
itself](https://docs.astral.sh/ruff/editors/settings)**.

Preview features

- Formatter: Insert empty line between suite and alternative branch after function/class definition ([12294](https://github.com/astral-sh/ruff/pull/12294))
- \[`pyupgrade`\] Implement `unnecessary-default-type-args` (`UP043`) ([12371](https://github.com/astral-sh/ruff/pull/12371))

Rule changes

- \[`flake8-bugbear`\] Detect enumerate iterations in `loop-iterator-mutation` (`B909`) ([12366](https://github.com/astral-sh/ruff/pull/12366))
- \[`flake8-bugbear`\] Remove `discard`, `remove`, and `pop` allowance for `loop-iterator-mutation` (`B909`) ([12365](https://github.com/astral-sh/ruff/pull/12365))
- \[`pylint`\] Allow `repeated-equality-comparison` for mixed operations (`PLR1714`) ([12369](https://github.com/astral-sh/ruff/pull/12369))
- \[`pylint`\] Ignore `self` and `cls` when counting arguments (`PLR0913`) ([12367](https://github.com/astral-sh/ruff/pull/12367))
- \[`pylint`\] Use UTF-8 as default encoding in `unspecified-encoding` fix (`PLW1514`) ([12370](https://github.com/astral-sh/ruff/pull/12370))

Server

- Build settings index in parallel for the native server ([12299](https://github.com/astral-sh/ruff/pull/12299))
- Use fallback settings when indexing the project ([12362](https://github.com/astral-sh/ruff/pull/12362))
- Consider `--preview` flag for `server` subcommand for the linter and formatter ([12208](https://github.com/astral-sh/ruff/pull/12208))

Bug fixes

- \[`flake8-comprehensions`\] Allow additional arguments for `sum` and `max` comprehensions (`C419`) ([12364](https://github.com/astral-sh/ruff/pull/12364))
- \[`pylint`\] Avoid dropping extra boolean operations in `repeated-equality-comparison` (`PLR1714`) ([12368](https://github.com/astral-sh/ruff/pull/12368))
- \[`pylint`\] Consider expression before statement when determining binding kind (`PLR1704`) ([12346](https://github.com/astral-sh/ruff/pull/12346))

Documentation

- Add docs for Ruff language server ([12344](https://github.com/astral-sh/ruff/pull/12344))
- Migrate to standalone docs repo ([12341](https://github.com/astral-sh/ruff/pull/12341))
- Update versioning policy for editor integration ([12375](https://github.com/astral-sh/ruff/pull/12375))

Other changes

- Publish Wasm API to npm ([12317](https://github.com/astral-sh/ruff/pull/12317))

0.5.2

Preview features

- Use `space` separator before parenthesized expressions in comprehensions with leading comments ([12282](https://github.com/astral-sh/ruff/pull/12282))
- \[`flake8-async`\] Update `ASYNC100` to include `anyio` and `asyncio` ([12221](https://github.com/astral-sh/ruff/pull/12221))
- \[`flake8-async`\] Update `ASYNC109` to include `anyio` and `asyncio` ([12236](https://github.com/astral-sh/ruff/pull/12236))
- \[`flake8-async`\] Update `ASYNC110` to include `anyio` and `asyncio` ([12261](https://github.com/astral-sh/ruff/pull/12261))
- \[`flake8-async`\] Update `ASYNC115` to include `anyio` and `asyncio` ([12262](https://github.com/astral-sh/ruff/pull/12262))
- \[`flake8-async`\] Update `ASYNC116` to include `anyio` and `asyncio` ([12266](https://github.com/astral-sh/ruff/pull/12266))

Rule changes

- \[`flake8-return`\] Exempt properties from explicit return rule (`RET501`) ([12243](https://github.com/astral-sh/ruff/pull/12243))
- \[`numpy`\] Add `np.NAN`-to-`np.nan` diagnostic ([12292](https://github.com/astral-sh/ruff/pull/12292))
- \[`refurb`\] Make `list-reverse-copy` an unsafe fix ([12303](https://github.com/astral-sh/ruff/pull/12303))

Server

- Consider `include` and `extend-include` settings in native server ([12252](https://github.com/astral-sh/ruff/pull/12252))
- Include nested configurations in settings reloading ([12253](https://github.com/astral-sh/ruff/pull/12253))

CLI

- Omit code frames for fixes with empty ranges ([12304](https://github.com/astral-sh/ruff/pull/12304))
- Warn about formatter incompatibility for `D203` ([12238](https://github.com/astral-sh/ruff/pull/12238))

Bug fixes

- Make cache-write failures non-fatal on Windows ([12302](https://github.com/astral-sh/ruff/pull/12302))
- Treat `not` operations as boolean tests ([12301](https://github.com/astral-sh/ruff/pull/12301))
- \[`flake8-bandit`\] Avoid `S310` violations for HTTP-safe f-strings ([12305](https://github.com/astral-sh/ruff/pull/12305))
- \[`flake8-bandit`\] Support explicit string concatenations in S310 HTTP detection ([12315](https://github.com/astral-sh/ruff/pull/12315))
- \[`flake8-bandit`\] fix S113 false positive for httpx without `timeout` argument ([12213](https://github.com/astral-sh/ruff/pull/12213))
- \[`pycodestyle`\] Remove "non-obvious" allowance for E721 ([12300](https://github.com/astral-sh/ruff/pull/12300))
- \[`pyflakes`\] Consider `with` blocks as single-item branches for redefinition analysis ([12311](https://github.com/astral-sh/ruff/pull/12311))
- \[`refurb`\] Restrict forwarding for `newline` argument in `open()` calls to Python versions >= 3.10 ([12244](https://github.com/astral-sh/ruff/pull/12244))

Documentation

- Update help and documentation to reflect `--output-format full` default ([12248](https://github.com/astral-sh/ruff/pull/12248))

Performance

- Use more threads when discovering Python files ([12258](https://github.com/astral-sh/ruff/pull/12258))

0.5.1

Preview features

- \[`flake8-bugbear`\] Implement mutable-contextvar-default (B039) ([12113](https://github.com/astral-sh/ruff/pull/12113))
- \[`pycodestyle`\] Whitespace after decorator (`E204`) ([12140](https://github.com/astral-sh/ruff/pull/12140))
- \[`pytest`\] Reverse `PT001` and `PT0023` defaults ([12106](https://github.com/astral-sh/ruff/pull/12106))

Rule changes

- Enable token-based rules on source with syntax errors ([11950](https://github.com/astral-sh/ruff/pull/11950))
- \[`flake8-bandit`\] Detect `httpx` for `S113` ([12174](https://github.com/astral-sh/ruff/pull/12174))
- \[`numpy`\] Update `NPY201` to include exception deprecations ([12065](https://github.com/astral-sh/ruff/pull/12065))
- \[`pylint`\] Generate autofix for `duplicate-bases` (`PLE0241`) ([12105](https://github.com/astral-sh/ruff/pull/12105))

Server

- Avoid syntax error notification for source code actions ([12148](https://github.com/astral-sh/ruff/pull/12148))
- Consider the content of the new cells during notebook sync ([12203](https://github.com/astral-sh/ruff/pull/12203))
- Fix replacement edit range computation ([12171](https://github.com/astral-sh/ruff/pull/12171))

Bug fixes

- Disable auto-fix when source has syntax errors ([12134](https://github.com/astral-sh/ruff/pull/12134))
- Fix cache key collisions for paths with separators ([12159](https://github.com/astral-sh/ruff/pull/12159))
- Make `requires-python` inference robust to `==` ([12091](https://github.com/astral-sh/ruff/pull/12091))
- Use char-wise width instead of `str`-width ([12135](https://github.com/astral-sh/ruff/pull/12135))
- \[`pycodestyle`\] Avoid `E275` if keyword followed by comma ([12136](https://github.com/astral-sh/ruff/pull/12136))
- \[`pycodestyle`\] Avoid `E275` if keyword is followed by a semicolon ([12095](https://github.com/astral-sh/ruff/pull/12095))
- \[`pylint`\] Skip [dummy variables](https://docs.astral.sh/ruff/settings/#lint_dummy-variable-rgx) for `PLR1704` ([12190](https://github.com/astral-sh/ruff/pull/12190))

Performance

- Remove allocation in `parse_identifier` ([12103](https://github.com/astral-sh/ruff/pull/12103))
- Use `CompactString` for `Identifier` AST node ([12101](https://github.com/astral-sh/ruff/pull/12101))

Page 18 of 28

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.