mirror of
https://github.com/astral-sh/ruff
synced 2026-01-21 13:30:49 -05:00
Summary -- During the release today, I noticed that the changelog is finally too long to render at all on GitHub. This PR follows the same splitting procedure as in uv (astral-sh/uv#11510, astral-sh/uv#12099): first splitting the file into one per minor version, and then reversing the contents of each file to start with the breaking release (`changelogs/0.11.x.md` starts with 0.11.0 instead of 0.11.13 as in the old changelog). For the second part, I used [`reverse-changelog.py`](https://github.com/astral-sh/uv/blob/main/scripts/reverse-changelog.py) from the uv repo, so hopefully everything is correct. I spot-checked 0.7.0 at least.
13 KiB
13 KiB
Changelog 0.7.x
0.7.0
Check out the blog post for a migration guide and overview of the changes!
Breaking changes
- The pytest rules
PT001andPT023now 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-exceptrule (in ourtryceratopscategory) has been recoded fromTRY302toTRY203(#13502). This ensures Ruff's code is consistent with the same rule in thetryceratopslinter. - The
lint.allow-unused-importssetting has been removed (#13677). Uselint.pyflakes.allow-unused-importsinstead.
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] MarkPLE1141fix as unsafe (#13629) - [
flake8-async] Consider async generators to be "checkpoints" forcancel-scope-no-checkpoint(ASYNC100) (#13639) - [
flake8-bugbear] Do not suggest setting parameterstrict=toFalseinB905diagnostic 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 forSIM115so that the rule can detect files being opened from a wider range of standard-library functions (#12959).
CLI
- Add explanation of fixable in
--statisticscommand (#13774)
Bug fixes
- [
pyflakes] Allowipytestcell magic (F401) (#13745) - [
flake8-use-pathlib] FixPTH123false positive whenopenis passed a file descriptor (#13616) - [
flake8-bandit] Detect patterns from multi line SQL statements (S608) (#13574) - [
flake8-pyi] - Fix dropped expressions inPYI030autofix (#13727)
0.7.1
Preview features
- Fix
E221andE222to 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-setto 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
ARG002compatible withEM101when raisingNotImplementedError(#13714)
Other changes
- Introduce more Docker tags for Ruff (similar to uv) (#13274)
0.7.2
Preview features
- Fix formatting of single with-item with trailing comment (#14005)
- [
pyupgrade] Add PEP 646Unpackconversion to*with fix (UP044) (#13988)
Rule changes
- Regenerate
known_stdlibs.rswith 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 ofsingledispatchas runtime-required (TCH003) (#13957)
Documentation
- [
flake8-simplify] Include caveats of enablingif-else-block-instead-of-if-exp(SIM108) (#14019)
0.7.3
Preview features
- Formatter: Disallow single-line implicit concatenated strings (#13928)
- [
flake8-pyi] Include all Python file types forPYI006andPYI066(#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 always 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-defaulton stubs (B006) (#14058) - [
flake8-builtins] Skip lambda expressions inbuiltin-argument-shadowing (A002)(#14144) - [
flake8-comprehension] Also remove trailing comma while fixingC409andC419(#14097) - [
flake8-simplify] Allowopenwithout context manager inreturnstatement (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)
0.7.4
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-callfromflake8-markupsafeplugin (RUF035) (#14224) - [
ruff] Report problems forattrsdataclasses (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-importsforPLC014(#14287) - [
flake8-type-checking] Skip quoting annotation if it becomes invalid syntax (TCH001) - [
flake8-pyi] Avoid usingtyping.Selfin stub files pre-Python 3.11 (PYI034) (#14230) - [
flake8-pytest-style] Flagpytest.raisescall 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] Allowawaitat the top-level scope of a notebook (PLE1142) (#14225) - [
pylint] Fix miscellaneous issues inawait-outside-asyncdetection (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-charsetfor reordered sets (FURB156) (#14233) - [
refurb] Further special cases added toverbose-decimal-constructor(FURB157) (#14216) - [
refurb] UseUserStringinstead of non-existentUserStr(FURB189) (#14209) - [
ruff] Avoid treating lowercase letters as# noqacodes (RUF100) (#14229) - [
ruff] Do not report whenOptionalhas no type arguments (RUF013) (#14181)