Skip to content

Commit a1fdd66

Browse files
authored
Bump 0.13.0 (#20336)
1 parent 8770b95 commit a1fdd66

File tree

12 files changed

+683
-528
lines changed

12 files changed

+683
-528
lines changed

BREAKING_CHANGES.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,44 @@
11
# Breaking Changes
22

3+
## 0.13.0
4+
5+
- **Several rules can now add `from __future__ import annotations` automatically**
6+
7+
`TC001`, `TC002`, `TC003`, `RUF013`, and `UP037` now add `from __future__ import annotations` as part of their fixes when the
8+
`lint.future-annotations` setting is enabled. This allows the rules to move
9+
more imports into `TYPE_CHECKING` blocks (`TC001`, `TC002`, and `TC003`),
10+
use PEP 604 union syntax on Python versions before 3.10 (`RUF013`), and
11+
unquote more annotations (`UP037`).
12+
13+
- **Full module paths are now used to verify first-party modules**
14+
15+
Ruff now checks that the full path to a module exists on disk before
16+
categorizing it as a first-party import. This change makes first-party
17+
import detection more accurate, helping to avoid false positives on local
18+
directories with the same name as a third-party dependency, for example. See
19+
the [FAQ
20+
section](https://docs.astral.sh/ruff/faq/#how-does-ruff-determine-which-of-my-imports-are-first-party-third-party-etc) on import categorization for more details.
21+
22+
- **Deprecated rules must now be selected by exact rule code**
23+
24+
Ruff will no longer activate deprecated rules selected by their group name
25+
or prefix. As noted below, the two remaining deprecated rules were also
26+
removed in this release, so this won't affect any current rules, but it will
27+
still affect any deprecations in the future.
28+
29+
- **The deprecated macOS configuration directory fallback has been removed**
30+
31+
Ruff will no longer look for a user-level configuration file at
32+
`~/Library/Application Support/ruff/ruff.toml` on macOS. This feature was
33+
deprecated in v0.5 in favor of using the [XDG
34+
specification](https://specifications.freedesktop.org/basedir-spec/latest/)
35+
(usually resolving to `~/.config/ruff/ruff.toml`), like on Linux. The
36+
fallback and accompanying deprecation warning have now been removed.
37+
38+
- **[`pandas-df-variable-name`](https://docs.astral.sh/ruff/rules/pandas-df-variable-name) (`PD901`) has been removed**
39+
40+
- **[`non-pep604-isinstance`](https://docs.astral.sh/ruff/rules/non-pep604-isinstance) (`UP038`) has been removed**
41+
342
## 0.12.0
443

544
- **Detection of more syntax errors**

CHANGELOG.md

Lines changed: 77 additions & 512 deletions
Large diffs are not rendered by default.

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ curl -LsSf https://astral.sh/ruff/install.sh | sh
148148
powershell -c "irm https://astral.sh/ruff/install.ps1 | iex"
149149

150150
# For a specific version.
151-
curl -LsSf https://astral.sh/ruff/0.12.12/install.sh | sh
152-
powershell -c "irm https://astral.sh/ruff/0.12.12/install.ps1 | iex"
151+
curl -LsSf https://astral.sh/ruff/0.13.0/install.sh | sh
152+
powershell -c "irm https://astral.sh/ruff/0.13.0/install.ps1 | iex"
153153
```
154154

155155
You can also install Ruff via [Homebrew](https://formulae.brew.sh/formula/ruff), [Conda](https://anaconda.org/conda-forge/ruff),
@@ -182,7 +182,7 @@ Ruff can also be used as a [pre-commit](https://pre-commit.com/) hook via [`ruff
182182
```yaml
183183
- repo: https://github.com/astral-sh/ruff-pre-commit
184184
# Ruff version.
185-
rev: v0.12.12
185+
rev: v0.13.0
186186
hooks:
187187
# Run the linter.
188188
- id: ruff-check

changelogs/0.12.x.md

Lines changed: 551 additions & 0 deletions
Large diffs are not rendered by default.

crates/ruff/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ruff"
3-
version = "0.12.12"
3+
version = "0.13.0"
44
publish = true
55
authors = { workspace = true }
66
edition = { workspace = true }

crates/ruff_linter/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ruff_linter"
3-
version = "0.12.12"
3+
version = "0.13.0"
44
publish = false
55
authors = { workspace = true }
66
edition = { workspace = true }

crates/ruff_wasm/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ruff_wasm"
3-
version = "0.12.12"
3+
version = "0.13.0"
44
publish = false
55
authors = { workspace = true }
66
edition = { workspace = true }

docs/integrations.md

Lines changed: 4 additions & 4 deletions
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.12.12-alpine
83+
name: ghcr.io/astral-sh/ruff:0.13.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.12.12
109+
rev: v0.13.0
110110
hooks:
111111
# Run the linter.
112112
- id: ruff-check
@@ -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.12.12
122+
rev: v0.13.0
123123
hooks:
124124
# Run the linter.
125125
- id: ruff-check
@@ -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.12.12
136+
rev: v0.13.0
137137
hooks:
138138
# Run the linter.
139139
- id: ruff-check

docs/tutorial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ This tutorial has focused on Ruff's command-line interface, but Ruff can also be
369369
```yaml
370370
- repo: https://github.com/astral-sh/ruff-pre-commit
371371
# Ruff version.
372-
rev: v0.12.12
372+
rev: v0.13.0
373373
hooks:
374374
# Run the linter.
375375
- id: ruff

0 commit comments

Comments
 (0)