Skip to content

Commit 2cd25ef

Browse files
authored
Ruff 0.11.0 (#16723)
## Summary Follow-up release for Ruff v0.10 that now includes the following two changes that we intended to ship but slipped: * Changes to how the Python version is inferred when a `target-version` is not specified (#16319) * `blanket-noqa` (`PGH004`): Also detect blanked file-level noqa comments (and not just line level comments). ## Test plan I verified that the binary built on this branch respects the `requires-python` setting ([logs](https://www.diffchecker.com/qyJWYi6W/), left: v0.10, right: v0.11)
1 parent a22d206 commit 2cd25ef

File tree

11 files changed

+51
-22
lines changed

11 files changed

+51
-22
lines changed

BREAKING_CHANGES.md

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Breaking Changes
22

3-
## 0.10.0
3+
## 0.11.0
4+
5+
This is a follow-up to release 0.10.0. Because of a mistake in the release process, the `requires-python` inference changes were not included in that release. Ruff 0.11.0 now includes this change as well as the stabilization of the preview behavior for `PGH004`.
46

57
- **Changes to how the Python version is inferred when a `target-version` is not specified** ([#16319](https://github.com/astral-sh/ruff/pull/16319))
68

@@ -23,6 +25,13 @@
2325
search for the closest `pyproject.toml` in the parent directories and use its
2426
`requires-python` setting.
2527

28+
## 0.10.0
29+
30+
- **Changes to how the Python version is inferred when a `target-version` is not specified** ([#16319](https://github.com/astral-sh/ruff/pull/16319))
31+
32+
Because of a mistake in the release process, the `requires-python` inference changes are not included in this release and instead shipped as part of 0.11.0.
33+
You can find a description of this change in the 0.11.0 section.
34+
2635
- **Updated `TYPE_CHECKING` behavior** ([#16669](https://github.com/astral-sh/ruff/pull/16669))
2736

2837
Previously, Ruff only recognized typechecking blocks that tested the `typing.TYPE_CHECKING` symbol. Now, Ruff recognizes any local variable named `TYPE_CHECKING`. This release also removes support for the legacy `if 0:` and `if False:` typechecking checks. Use a local `TYPE_CHECKING` variable instead.

CHANGELOG.md

+25-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
# Changelog
22

3-
## 0.10.0
3+
## 0.11.0
44

5-
Check out the [blog post](https://astral.sh/blog/ruff-v0.10.0) for a migration guide and overview of the changes!
5+
This is a follow-up to release 0.10.0. Because of a mistake in the release process, the `requires-python` inference changes were not included in that release. Ruff 0.11.0 now includes this change as well as the stabilization of the preview behavior for `PGH004`.
66

77
### Breaking changes
88

9-
See also, the "Remapped rules" section which may result in disabled rules.
10-
119
- **Changes to how the Python version is inferred when a `target-version` is not specified** ([#16319](https://github.com/astral-sh/ruff/pull/16319))
1210

1311
In previous versions of Ruff, you could specify your Python version with:
@@ -29,6 +27,29 @@ See also, the "Remapped rules" section which may result in disabled rules.
2927
search for the closest `pyproject.toml` in the parent directories and use its
3028
`requires-python` setting.
3129

30+
### Stabilization
31+
32+
The following behaviors have been stabilized:
33+
34+
- [`blanket-noqa`](https://docs.astral.sh/ruff/rules/blanket-noqa/) (`PGH004`): Also detect blanked file-level noqa comments (and not just line level comments).
35+
36+
### Preview features
37+
38+
- [syntax-errors] Tuple unpacking in `for` statement iterator clause before Python 3.9 ([#16558](https://github.com/astral-sh/ruff/pull/16558))
39+
40+
## 0.10.0
41+
42+
Check out the [blog post](https://astral.sh/blog/ruff-v0.10.0) for a migration guide and overview of the changes!
43+
44+
### Breaking changes
45+
46+
See also, the "Remapped rules" section which may result in disabled rules.
47+
48+
- **Changes to how the Python version is inferred when a `target-version` is not specified** ([#16319](https://github.com/astral-sh/ruff/pull/16319))
49+
50+
Because of a mistake in the release process, the `requires-python` inference changes are not included in this release and instead shipped as part of 0.11.0.
51+
You can find a description of this change in the 0.11.0 section.
52+
3253
- **Updated `TYPE_CHECKING` behavior** ([#16669](https://github.com/astral-sh/ruff/pull/16669))
3354

3455
Previously, Ruff only recognized typechecking blocks that tested the `typing.TYPE_CHECKING` symbol. Now, Ruff recognizes any local variable named `TYPE_CHECKING`. This release also removes support for the legacy `if 0:` and `if False:` typechecking checks. Use a local `TYPE_CHECKING` variable instead.
@@ -86,7 +107,6 @@ The following behaviors have been stabilized:
86107

87108
- [`bad-staticmethod-argument`](https://docs.astral.sh/ruff/rules/bad-staticmethod-argument/) (`PLW0211`) [`invalid-first-argument-name-for-class-method`](https://docs.astral.sh/ruff/rules/invalid-first-argument-name-for-class-method/) (`N804`): `__new__` methods are now no longer flagged by `invalid-first-argument-name-for-class-method` (`N804`) but instead by `bad-staticmethod-argument` (`PLW0211`)
88109
- [`bad-str-strip-call`](https://docs.astral.sh/ruff/rules/bad-str-strip-call/) (`PLE1310`): The rule now applies to objects which are known to have type `str` or `bytes`.
89-
- [`blanket-noqa`](https://docs.astral.sh/ruff/rules/blanket-noqa/) (`PGH004`): Also detect blanked file-level noqa comments (and not just line level comments).
90110
- [`custom-type-var-for-self`](https://docs.astral.sh/ruff/rules/custom-type-var-for-self/) (`PYI019`): More accurate detection of custom `TypeVars` replaceable by `Self`. The range of the diagnostic is now the full function header rather than just the return annotation.
91111
- [`invalid-argument-name`](https://docs.astral.sh/ruff/rules/invalid-argument-name/) (`N803`): Ignore argument names of functions decorated with `typing.override`
92112
- [`invalid-envvar-default`](https://docs.astral.sh/ruff/rules/invalid-envvar-default/) (`PLW1508`): Detect default value arguments to `os.environ.get` with invalid type.

Cargo.lock

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ curl -LsSf https://astral.sh/ruff/install.sh | sh
149149
powershell -c "irm https://astral.sh/ruff/install.ps1 | iex"
150150

151151
# For a specific version.
152-
curl -LsSf https://astral.sh/ruff/0.10.0/install.sh | sh
153-
powershell -c "irm https://astral.sh/ruff/0.10.0/install.ps1 | iex"
152+
curl -LsSf https://astral.sh/ruff/0.11.0/install.sh | sh
153+
powershell -c "irm https://astral.sh/ruff/0.11.0/install.ps1 | iex"
154154
```
155155

156156
You can also install Ruff via [Homebrew](https://formulae.brew.sh/formula/ruff), [Conda](https://anaconda.org/conda-forge/ruff),
@@ -183,7 +183,7 @@ Ruff can also be used as a [pre-commit](https://pre-commit.com/) hook via [`ruff
183183
```yaml
184184
- repo: https://github.com/astral-sh/ruff-pre-commit
185185
# Ruff version.
186-
rev: v0.10.0
186+
rev: v0.11.0
187187
hooks:
188188
# Run the linter.
189189
- id: ruff

crates/ruff/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ruff"
3-
version = "0.10.0"
3+
version = "0.11.0"
44
publish = true
55
authors = { workspace = true }
66
edition = { workspace = true }

crates/ruff_linter/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ruff_linter"
3-
version = "0.10.0"
3+
version = "0.11.0"
44
publish = false
55
authors = { workspace = true }
66
edition = { workspace = true }

crates/ruff_wasm/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ruff_wasm"
3-
version = "0.10.0"
3+
version = "0.11.0"
44
publish = false
55
authors = { workspace = true }
66
edition = { workspace = true }

docs/integrations.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ You can add the following configuration to `.gitlab-ci.yml` to run a `ruff forma
8080
stage: build
8181
interruptible: true
8282
image:
83-
name: ghcr.io/astral-sh/ruff:0.10.0-alpine
83+
name: ghcr.io/astral-sh/ruff:0.11.0-alpine
8484
before_script:
8585
- cd $CI_PROJECT_DIR
8686
- ruff --version
@@ -106,7 +106,7 @@ Ruff can be used as a [pre-commit](https://pre-commit.com) hook via [`ruff-pre-c
106106
```yaml
107107
- repo: https://github.com/astral-sh/ruff-pre-commit
108108
# Ruff version.
109-
rev: v0.10.0
109+
rev: v0.11.0
110110
hooks:
111111
# Run the linter.
112112
- id: ruff
@@ -119,7 +119,7 @@ To enable lint fixes, add the `--fix` argument to the lint hook:
119119
```yaml
120120
- repo: https://github.com/astral-sh/ruff-pre-commit
121121
# Ruff version.
122-
rev: v0.10.0
122+
rev: v0.11.0
123123
hooks:
124124
# Run the linter.
125125
- id: ruff
@@ -133,7 +133,7 @@ To avoid running on Jupyter Notebooks, remove `jupyter` from the list of allowed
133133
```yaml
134134
- repo: https://github.com/astral-sh/ruff-pre-commit
135135
# Ruff version.
136-
rev: v0.10.0
136+
rev: v0.11.0
137137
hooks:
138138
# Run the linter.
139139
- id: ruff

docs/tutorial.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ This tutorial has focused on Ruff's command-line interface, but Ruff can also be
365365
```yaml
366366
- repo: https://github.com/astral-sh/ruff-pre-commit
367367
# Ruff version.
368-
rev: v0.10.0
368+
rev: v0.11.0
369369
hooks:
370370
# Run the linter.
371371
- id: ruff

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "maturin"
44

55
[project]
66
name = "ruff"
7-
version = "0.10.0"
7+
version = "0.11.0"
88
description = "An extremely fast Python linter and code formatter, written in Rust."
99
authors = [{ name = "Astral Software Inc.", email = "[email protected]" }]
1010
readme = "README.md"

scripts/benchmarks/pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "scripts"
3-
version = "0.10.0"
3+
version = "0.11.0"
44
description = ""
55
authors = ["Charles Marsh <[email protected]>"]
66

0 commit comments

Comments
 (0)