Skip to content

Releases: astral-sh/ruff

v0.0.278

12 Jul 17:06
0ead9a1
Compare
Choose a tag to compare

See the release blog post for more, including detailed descriptions of any newly added rules.

What's Changed

Rules

  • [pylint] Implement typevar-bivariance (PLC0131) by @tjkuson in #5517
  • [flake8-pyi] Implement unnecessary-literal-union (PYI030) by @zanieb in #5570
  • [pylint] Implement type-name-incorrect-variance (PLC0105) by @tjkuson in #5651
  • [ruff] Implement unnecessary-list-allocation-for-first-element (RUF015) by @evanrittenhouse in #5549
  • [flake8-bugbear] Implement re-sub-positional-args (B034) by @charliermarsh in #5669
  • [ruff] Implement invalid-index-type (RUF016) by @zanieb in #5602

Settings

Bug Fixes

New Contributors

Full Changelog: v0.0.277...v0.0.278

v0.0.277

06 Jul 02:44
324455f
Compare
Choose a tag to compare

What's Changed

Breaking Changes

  • Add .ipynb_checkpoints, .pyenv, .pytest_cache, and .vscode to default excludes by @charliermarsh in #5513

Rules

  • [pylint] Implement Pylint typevar-name-mismatch (C0132) by @tjkuson in #5501

Settings

  • Add ruff rule --all subcommand (with JSON output) by @akx in #5059

Bug Fixes

Full Changelog: v0.0.276...v0.0.277

v0.0.276

03 Jul 18:58
3992c47
Compare
Choose a tag to compare

See the release blog post for more, including detailed descriptions of any newly added rules.

What's Changed

Highlights include: experimental support for linting Jupyter Notebooks.

To opt-in to linting Jupyter Notebook files, add the *.ipynb pattern to your include
setting, like so:

[tool.ruff]
# Allow Ruff to discover `*.ipynb` files.
include = ["*.py", "*.pyi", "**/pyproject.toml", "*.ipynb"]

This will prompt Ruff to discover Jupyter Notebook files in any specified directories, and lint them
accordingly.

Jupyter Notebook support is currently opt-in and experimental. We'd love your help testing it out.
Have feedback? Run into issues? Let us know!

New Rules

  • [flake8-pyi] Implement PYI002, PYI003, PYI004, PYI005 by @density in #5457
  • [numpy] Implement numpy-deprecated-function (NPY003) by @charliermarsh in #5468
  • [perflint] Implement unnecessary-list-cast (PERF101) by @qdegraaf in #5121
  • [perflint] Implement try-except-in-loop (PERF203) by @evanrittenhouse in #5166
  • [perflint] Implement manual-list-comprehension (PERF401) and manual-list-copy (PERF402) rules by @qdegraaf in #5298
  • [pylint] Implement Pylint single-string-used-for-slots (C0205) as single-string-slots (PLC0205) by @tjkuson in #5399

Jupyter

Settings

Bug Fixes

New Contributors

Full Changelog: v0.0.275...v0.0.276

v0.0.275

22 Jun 17:25
5dd00b1
Compare
Choose a tag to compare

What's Changed

Highlights include a 7-10x decrease in Ruff's cache size.

Rules

Bug Fixes

New Contributors

Full Changelog: v0.0.274...v0.0.275

v0.0.274

21 Jun 03:54
a332f07
Compare
Choose a tag to compare

What's Changed

Follow-up release to v0.0.273 to fix a panic in cache accesses.

Bug Fixes

Full Changelog: v0.0.273...v0.0.274

v0.0.273

20 Jun 19:24
fde5dbc
Compare
Choose a tag to compare

What's Changed

Highlights include:

  • Autofix capabilities for rules like flake8-import-conventions, which require symbol renames across a file.
  • Significant decrease in Ruff's cache size (e.g., a ~50% decrease for FastAPI).
  • Dozens and dozens of bug fixes + performance improvements.

Rules

  • [copyright] Implement copyright notice detection by @Ryang20718 in #4701
  • [flake8-datetimez] Enable UTC-import for datetime-utc-alias fix by @charliermarsh in #5100
  • [flake8-implicit-str-concat] Add autofix for ISC001 by @tkukushkin in #4853
  • [flake8-import-conventions] Enable autofix for unconventional imports rule by @charliermarsh in #5152
  • [flake8-pyi] Add autofix for Set-to-AbstractSet rewrite using reference tracking by @charliermarsh in #5074
  • [flake8-pyi] Implement PYI044 by @Thomasdezeeuw in #5021
  • [flake8-return] Extend revised RET504 implementation to with statements by @charliermarsh in #4998
  • [flake8-return] Implement autofix for revised RET504 rule by @charliermarsh in #4999
  • [flake8-return] Refactor RET504 to only enforce assignment-then-return pattern by @charliermarsh in #4997
  • [flake8-slots] Add plugin, add SLOT000, SLOT001 and SLOT002 by @qdegraaf in #4909
  • [perflint] Add perflint plugin, add first rule PERF102 by @qdegraaf in #4821
  • [pylint] Add Pylint rule comparison-with-itself (R0124) by @tjkuson in #4957
  • [pyupgrade] Add a rule to remove unnecessary parentheses in class definitions by @charliermarsh in #5032
  • [ruff] Add a rule for static keys in dict comprehensions by @rodjunger in #4929
  • [ruff] Add rule to disallow implicit optional with autofix by @dhruvmanila in #4831
  • [ruff] Expand RUF008 to all classes, but to a new code (RUF012) by @adampauls in #4390
  • [ruff] Remove unannotated attributes from RUF008 by @charliermarsh in #5049
  • [ruff] Upgrade explicit-type-conversion rule (RUF010) to remove unnecessary str calls by @charliermarsh in #4971

Settings

Caching

Jupyter

Bug Fixes

New Contributors

Full Changelog: v0.0.272...v0.0.273

v0.0.272

08 Jun 02:49
4b78141
Compare
Choose a tag to compare

What's Changed

Breaking Changes

Rules

Bug Fixes

Full Changelog: v0.0.271...v0.0.272

v0.0.271

06 Jun 22:57
7cc205b
Compare
Choose a tag to compare

What's Changed

Rules

Settings

Bug Fixes

New Contributors

Full Changelog: v0.0.270...v0.0.271

v0.0.270

24 May 19:37
09c50c3
Compare
Choose a tag to compare

What's Changed

Rules

Settings

Bug Fixes

New Contributors

Full Changelog: v0.0.269...v0.0.270

v0.0.269

18 May 20:32
d4c0a41
Compare
Choose a tag to compare

What's Changed

(This is a rerelease of v0.0.268, which didn't make it to PyPI due to user error. As such, the release notes are copied below.)

pycodestyle

This release includes optimized implementations of a large portion of pycodestyle, for those that use Ruff without an autoformatter.

In this initial release, the rules are being introduced under a "nursery" flag, which requires that users explicitly select them (e.g., select = ["E111"]); in other words, these rules are not yet enabled via select = ["E"].

If you're interested in testing the pycodestyle rules, you can enable them via:

select = [
    "E111", "E112", "E113", "E114", "E115", "E116", "E117",
    "E201", "E202", "E203", "E211", "E221", "E222", "E223",
    "E224", "E225", "E226", "E227", "E228", "E231", "E251",
    "E252", "E261", "E262", "E265", "E266", "E271", "E272",
    "E273", "E274", "E275",
]

These rules will be included as part of the E category in a future release.

Breaking Changes

Rules

Settings

Bug Fixes

New Contributors

Full Changelog: v0.0.267...v0.0.269