Sourced from ruff's releases.
v0.0.292
What's Changed
Highlights
This release includes full support for Python 3.12 (out now!), including the new type parameter (PEP 695) and f-string syntaxes (PEP 701).
PEP 701 lifts many of the restrictions on f-strings that existed in the past, allowing for arbitrarily nested f-strings, consistent quote style within f-strings, and more, all of which are now supported by Ruff (thanks to
@dhruvmanila
in astral-sh/ruff#7376).Breaking Changes
- In the formatter,
format.quote-style
no longer affects triple-quoted strings, to align with common conventions as well as the guidance from PEP 8 and PEP 257 (see: astral-sh/ruff#7680).line-too-long
(E501
) now ignores trailing pragma comments (like# type: ignore
and# noqa
) when computing line length (see: astral-sh/ruff#7692). This is similar to flake8-bugbear's methodology for detecting overlong lines, and ensures that adding pragmas like# noqa
does not introduce further lint errors.Rules
- [
refurb
] Implementprint-empty-string
(FURB105
) by@tjkuson
in astral-sh/ruff#7617- [
flake8-bandit
] Implementweak-cryptographic-key
(S505
) by@mkniewallner
in astral-sh/ruff#7703- [
refurb
] Implementimplicit-cwd
(FURB177
) by@danparizher
in astral-sh/ruff#7704unnecessary-pass
(PIE790
) now flags all unnecessarypass
statements; previously, the rule only flaggedpass
statements that followed a docstring in a two-statement body (see: astral-sh/ruff#7697).Settings
- Add
lint
section to Ruff configuration by@MichaReiser
in astral-sh/ruff#7549- Add
explicit-preview-rules
to toggle explicit selection of preview rules by@zanieb
in astral-sh/ruff#7390- Decrease PEP 593 error to a debug warning by
@charliermarsh
in astral-sh/ruff#7745- Write full Jupyter notebook to
stdout
by@charliermarsh
in astral-sh/ruff#7748- Extend
unnecessary-pass
(PIE790
) to trigger on all unnecessarypass
statements by@tjkuson
in astral-sh/ruff#7697Bug Fixes
- Ignore blank lines between comments when counting newlines-after-imports by
@charliermarsh
in astral-sh/ruff#7607- Avoid reordering mixed-indent-level comments after branches by
@charliermarsh
in astral-sh/ruff#7609- Avoid flagging B009 and B010 on starred expressions by
@charliermarsh
in astral-sh/ruff#7621- Use deletion for D215 full-line removals by
@charliermarsh
in astral-sh/ruff#7625- Avoid searching for bracketed comments in unparenthesized generators by
@charliermarsh
in astral-sh/ruff#7627- Update return type for
PT022
autofix by@dhruvmanila
in astral-sh/ruff#7613- Flag FURB105 with starred kwargs by
@charliermarsh
in astral-sh/ruff#7630- Don't suggest replacing
builtin.open()
withPath.open()
if the latter doesn't support all options by@konstin
in astral-sh/ruff#7637- Use 1-based cell indices consistently for Notebooks by
@dhruvmanila
in astral-sh/ruff#7662- Add
Expr::Name
checks to rules which useis_logger_candidate
by@qdegraaf
in astral-sh/ruff#7521- Ensure that B006 autofixes are inserted after imports by
@Hoxbro
in astral-sh/ruff#7629- Allow named expressions in
__all__
assignments by@charliermarsh
in astral-sh/ruff#7673- Include radix base prefix in large number representation by
@charliermarsh
in astral-sh/ruff#7700- Parenthesize multi-line attributes in B009 by
@charliermarsh
in astral-sh/ruff#7701- Insert necessary padding in B014 fixes by
@charliermarsh
in astral-sh/ruff#7699- fix(rules): improve S507 detection by
@mkniewallner
in astral-sh/ruff#7661- Ignore TODO tags in
commented-out-code
by@tjkuson
in astral-sh/ruff#7523- Track fix isolation in
unnecessary-pass
by@charliermarsh
in astral-sh/ruff#7715- Use fixed source code for parser context by
@charliermarsh
in astral-sh/ruff#7717- Preserve parentheses in
quadratic-list-summation
by@charliermarsh
in astral-sh/ruff#7719- Compute
NotebookIndex
forDiagnostics
on stdin by@dhruvmanila
in astral-sh/ruff#7663
... (truncated)
Sourced from ruff's changelog.
Breaking Changes
0.0.288
Remove support for emoji identifiers (#7212)
Previously, Ruff supported the non-standard compliant emoji identifiers e.g.
📦 = 1
. We decided to remove this non-standard language extension, and Ruff now reports syntax errors for emoji identifiers in your code, the same as CPython.Improved GitLab fingerprints (#7203)
GitLab uses fingerprints to identify new, existing, or fixed violations. Previously, Ruff included the violation's position in the fingerprint. Using the location has the downside that changing any code before the violation causes the fingerprint to change, resulting in GitLab reporting one fixed and one new violation even though it is a pre-existing violation.
Ruff now uses a more stable location-agnostic fingerprint to minimize that existing violations incorrectly get marked as fixed and re-reported as new violations.
Expect GitLab to report each pre-existing violation in your project as fixed and a new violation in your Ruff upgrade PR.
0.0.283 / 0.284
The target Python version now defaults to 3.8 instead of 3.10 (#6397)
Previously, when a target Python version was not specified, Ruff would use a default of Python 3.10. However, it is safer to default to an older Python version to avoid assuming the availability of new features. We now default to the oldest supported Python version which is currently Python 3.8.
(We still support Python 3.7 but since it has reached EOL we've decided not to make it the default here.)
Note this change was announced in 0.0.283 but not active until 0.0.284.
0.0.277
.ipynb_checkpoints
,.pyenv
,.pytest_cache
, and.vscode
are now excluded by default (#5513)Ruff maintains a list of default exclusions, which now consists of the following patterns:
.bzr
.direnv
.eggs
.git
.git-rewrite
.hg
.ipynb_checkpoints
.mypy_cache
.nox
.pants.d
.pyenv
.pytest_cache
.pytype
.ruff_cache
.svn
.tox
.venv
... (truncated)
c6d0bdd
Bump Ruff version to v0.0.292 (#7761)75f759e
Upgrade LibCST to support Python 3.12 (#7764)6b99f5e
Re-add formatter to GitHub release notes (#7763)97c092a
Add formatter TOML configuration to the README (#7762)bdf2852
Enable formatting for Jupyter notebooks (#7749)0961f00
Rename FixKind
to FixAvailability
(#7658)ebdfcee
Write full Jupyter notebook to stdout
(#7748)c71ff7e
Avoid printing continuations within import identifiers (#7744)0df2737
Bump memchr from 2.6.3 to 2.6.4 (#7758)c82d050
Bump thiserror from 1.0.48 to 1.0.49 (#7757)