Skip to content

Commit 0f47e9e

Browse files
committed
Merge branch 'main' into dcreager/tuple-spec
* main: (68 commits) Unify `OldDiagnostic` and `Message` (#18391) [`pylint`] Detect more exotic NaN literals in `PLW0177` (#18630) [`flake8-async`] Mark autofix for `ASYNC115` as unsafe if the call expression contains comments (#18753) [`flake8-bugbear`] Mark autofix for `B004` as unsafe if the `hasattr` call expr contains comments (#18755) Enforce `pytest` import for decorators (#18779) [`flake8-comprehension`] Mark autofix for `C420` as unsafe if there's comments inside the dict comprehension (#18768) [flake8-async] fix detection for large integer sleep durations in `ASYNC116` rule (#18767) Update dependency ruff to v0.12.0 (#18790) Update taiki-e/install-action action to v2.53.2 (#18789) Add lint rule for calling chmod with non-octal integers (#18541) Mark `RET501` fix unsafe if comments are inside (#18780) Use `LintContext::report_diagnostic_if_enabled` in `check_tokens` (#18769) [UP008]: use `super()`, not `__super__` in error messages (#18743) Use Depot Windows runners for `cargo test` (#18754) Run ty benchmarks when `ruff_benchmark` changes (#18758) Disallow newlines in format specifiers of single quoted f- or t-strings (#18708) [ty] Add more benchmarks (#18714) [ty] Anchor all exclude patterns (#18685) Include changelog reference for other major versions (#18745) Use updated pre-commit id (#18718) ...
2 parents 2bad8f2 + 10a1d9f commit 0f47e9e

File tree

316 files changed

+11535
-9825
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

316 files changed

+11535
-9825
lines changed

.github/actionlint.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,7 @@ self-hosted-runner:
77
- depot-ubuntu-latest-8
88
- depot-ubuntu-22.04-16
99
- depot-ubuntu-22.04-32
10+
- depot-windows-2022-16
1011
- github-windows-2025-x86_64-8
1112
- github-windows-2025-x86_64-16
13+
- codspeed-macro

.github/workflows/ci.yaml

Lines changed: 46 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ jobs:
184184
':crates/ruff_python_trivia/**' \
185185
':crates/ruff_source_file/**' \
186186
':crates/ruff_text_size/**' \
187+
':crates/ruff_benchmark/**' \
187188
':.github/workflows/ci.yaml' \
188189
; then
189190
echo "changed=false" >> "$GITHUB_OUTPUT"
@@ -239,11 +240,11 @@ jobs:
239240
- name: "Install mold"
240241
uses: rui314/setup-mold@b3958095189f34b95d402a680b6e96b7f194f7b9 # v1
241242
- name: "Install cargo nextest"
242-
uses: taiki-e/install-action@735e5933943122c5ac182670a935f54a949265c1 # v2.52.4
243+
uses: taiki-e/install-action@d12e869b89167df346dd0ff65da342d1fb1202fb # v2.53.2
243244
with:
244245
tool: cargo-nextest
245246
- name: "Install cargo insta"
246-
uses: taiki-e/install-action@735e5933943122c5ac182670a935f54a949265c1 # v2.52.4
247+
uses: taiki-e/install-action@d12e869b89167df346dd0ff65da342d1fb1202fb # v2.53.2
247248
with:
248249
tool: cargo-insta
249250
- name: ty mdtests (GitHub annotations)
@@ -297,11 +298,11 @@ jobs:
297298
- name: "Install mold"
298299
uses: rui314/setup-mold@b3958095189f34b95d402a680b6e96b7f194f7b9 # v1
299300
- name: "Install cargo nextest"
300-
uses: taiki-e/install-action@735e5933943122c5ac182670a935f54a949265c1 # v2.52.4
301+
uses: taiki-e/install-action@d12e869b89167df346dd0ff65da342d1fb1202fb # v2.53.2
301302
with:
302303
tool: cargo-nextest
303304
- name: "Install cargo insta"
304-
uses: taiki-e/install-action@735e5933943122c5ac182670a935f54a949265c1 # v2.52.4
305+
uses: taiki-e/install-action@d12e869b89167df346dd0ff65da342d1fb1202fb # v2.53.2
305306
with:
306307
tool: cargo-insta
307308
- name: "Run tests"
@@ -312,7 +313,7 @@ jobs:
312313

313314
cargo-test-windows:
314315
name: "cargo test (windows)"
315-
runs-on: github-windows-2025-x86_64-16
316+
runs-on: depot-windows-2022-16
316317
needs: determine_changes
317318
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-test') && (needs.determine_changes.outputs.code == 'true' || github.ref == 'refs/heads/main') }}
318319
timeout-minutes: 20
@@ -324,7 +325,7 @@ jobs:
324325
- name: "Install Rust toolchain"
325326
run: rustup show
326327
- name: "Install cargo nextest"
327-
uses: taiki-e/install-action@735e5933943122c5ac182670a935f54a949265c1 # v2.52.4
328+
uses: taiki-e/install-action@d12e869b89167df346dd0ff65da342d1fb1202fb # v2.53.2
328329
with:
329330
tool: cargo-nextest
330331
- name: "Run tests"
@@ -407,11 +408,11 @@ jobs:
407408
- name: "Install mold"
408409
uses: rui314/setup-mold@b3958095189f34b95d402a680b6e96b7f194f7b9 # v1
409410
- name: "Install cargo nextest"
410-
uses: taiki-e/install-action@735e5933943122c5ac182670a935f54a949265c1 # v2.52.4
411+
uses: taiki-e/install-action@d12e869b89167df346dd0ff65da342d1fb1202fb # v2.53.2
411412
with:
412413
tool: cargo-nextest
413414
- name: "Install cargo insta"
414-
uses: taiki-e/install-action@735e5933943122c5ac182670a935f54a949265c1 # v2.52.4
415+
uses: taiki-e/install-action@d12e869b89167df346dd0ff65da342d1fb1202fb # v2.53.2
415416
with:
416417
tool: cargo-insta
417418
- name: "Run tests"
@@ -893,7 +894,7 @@ jobs:
893894
run: npm run fmt:check
894895
working-directory: playground
895896

896-
benchmarks:
897+
benchmarks-instrumented:
897898
runs-on: ubuntu-24.04
898899
needs: determine_changes
899900
if: ${{ github.repository == 'astral-sh/ruff' && !contains(github.event.pull_request.labels.*.name, 'no-test') && (needs.determine_changes.outputs.code == 'true' || github.ref == 'refs/heads/main') }}
@@ -905,17 +906,51 @@ jobs:
905906
persist-credentials: false
906907

907908
- uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2.7.8
909+
- uses: astral-sh/setup-uv@f0ec1fc3b38f5e7cd731bb6ce540c5af426746bb # v6.1.0
910+
911+
- name: "Install Rust toolchain"
912+
run: rustup show
913+
914+
- name: "Install codspeed"
915+
uses: taiki-e/install-action@d12e869b89167df346dd0ff65da342d1fb1202fb # v2.53.2
916+
with:
917+
tool: cargo-codspeed
918+
919+
- name: "Build benchmarks"
920+
run: cargo codspeed build --features "codspeed,instrumented" --no-default-features -p ruff_benchmark
921+
922+
- name: "Run benchmarks"
923+
uses: CodSpeedHQ/action@0010eb0ca6e89b80c88e8edaaa07cfe5f3e6664d # v3.5.0
924+
with:
925+
run: cargo codspeed run
926+
token: ${{ secrets.CODSPEED_TOKEN }}
927+
928+
benchmarks-walltime:
929+
runs-on: codspeed-macro
930+
needs: determine_changes
931+
if: ${{ github.repository == 'astral-sh/ruff' && !contains(github.event.pull_request.labels.*.name, 'no-test') && (needs.determine_changes.outputs.ty == 'true' || github.ref == 'refs/heads/main') }}
932+
timeout-minutes: 20
933+
env:
934+
TY_LOG: ruff_benchmark=debug
935+
steps:
936+
- name: "Checkout Branch"
937+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
938+
with:
939+
persist-credentials: false
940+
941+
- uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2.7.8
942+
- uses: astral-sh/setup-uv@f0ec1fc3b38f5e7cd731bb6ce540c5af426746bb # v6.1.0
908943

909944
- name: "Install Rust toolchain"
910945
run: rustup show
911946

912947
- name: "Install codspeed"
913-
uses: taiki-e/install-action@735e5933943122c5ac182670a935f54a949265c1 # v2.52.4
948+
uses: taiki-e/install-action@d12e869b89167df346dd0ff65da342d1fb1202fb # v2.53.2
914949
with:
915950
tool: cargo-codspeed
916951

917952
- name: "Build benchmarks"
918-
run: cargo codspeed build --features codspeed -p ruff_benchmark
953+
run: cargo codspeed build --features "codspeed,walltime" --no-default-features -p ruff_benchmark
919954

920955
- name: "Run benchmarks"
921956
uses: CodSpeedHQ/action@0010eb0ca6e89b80c88e8edaaa07cfe5f3e6664d # v3.5.0

BREAKING_CHANGES.md

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

3+
## 0.12.0
4+
5+
- **Detection of more syntax errors**
6+
7+
Ruff now detects version-related syntax errors, such as the use of the `match`
8+
statement on Python versions before 3.10, and syntax errors emitted by
9+
CPython's compiler, such as irrefutable `match` patterns before the final
10+
`case` arm.
11+
12+
- **New default Python version handling for syntax errors**
13+
14+
Ruff will default to the _latest_ supported Python version (3.13) when
15+
checking for the version-related syntax errors mentioned above to prevent
16+
false positives in projects without a Python version configured. The default
17+
in all other cases, like applying lint rules, is unchanged and remains at the
18+
minimum supported Python version (3.9).
19+
20+
- **Updated f-string formatting**
21+
22+
Ruff now formats multi-line f-strings with format specifiers to avoid adding a
23+
line break after the format specifier. This addresses a change to the Python
24+
grammar in version 3.13.4 that made such a line break a syntax error.
25+
26+
- **`rust-toolchain.toml` is no longer included in source distributions**
27+
28+
The `rust-toolchain.toml` is used to specify a higher Rust version than Ruff's
29+
minimum supported Rust version (MSRV) for development and building release
30+
artifacts. However, when present in source distributions, it would also cause
31+
downstream package maintainers to pull in the same Rust toolchain, even if
32+
their available toolchain was MSRV-compatible.
33+
34+
- **[`suspicious-xmle-tree-usage`](https://docs.astral.sh/ruff/rules/suspicious-xmle-tree-usage/)
35+
(`S320`) has been removed**
36+
337
## 0.11.0
438

539
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`.

0 commit comments

Comments
 (0)