Skip to content

Commit c3c935b

Browse files
committed
Merge branch 'main' into typing-self-argument
2 parents 92c666b + 3d55a16 commit c3c935b

File tree

1,416 files changed

+14925
-7264
lines changed

Some content is hidden

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

1,416 files changed

+14925
-7264
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
<!--
2-
Thank you for contributing to Ruff! To help us out with reviewing, please consider the following:
2+
Thank you for contributing to Ruff/ty! To help us out with reviewing, please consider the following:
33
44
- Does this pull request include a summary of the change? (See below.)
5-
- Does this pull request include a descriptive title?
5+
- Does this pull request include a descriptive title? (Please prefix with `[ty]` for ty pull
6+
requests.)
67
- Does this pull request include references to any relevant issues?
78
-->
89

.github/workflows/build-docker.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040

4141
- uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3
4242

43-
- uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3
43+
- uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
4444
with:
4545
registry: ghcr.io
4646
username: ${{ github.repository_owner }}
@@ -79,7 +79,7 @@ jobs:
7979
# Adapted from https://docs.docker.com/build/ci/github-actions/multi-platform/
8080
- name: Build and push by digest
8181
id: build
82-
uses: docker/build-push-action@14487ce63c7a62a4a324b0bfb37086795e31c6c1 # v6
82+
uses: docker/build-push-action@14487ce63c7a62a4a324b0bfb37086795e31c6c1 # v6.16.0
8383
with:
8484
context: .
8585
platforms: ${{ matrix.platform }}
@@ -131,7 +131,7 @@ jobs:
131131
type=pep440,pattern={{ version }},value=${{ fromJson(inputs.plan).announcement_tag }}
132132
type=pep440,pattern={{ major }}.{{ minor }},value=${{ fromJson(inputs.plan).announcement_tag }}
133133
134-
- uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3
134+
- uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
135135
with:
136136
registry: ghcr.io
137137
username: ${{ github.repository_owner }}
@@ -169,7 +169,7 @@ jobs:
169169
steps:
170170
- uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3
171171

172-
- uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3
172+
- uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
173173
with:
174174
registry: ghcr.io
175175
username: ${{ github.repository_owner }}
@@ -231,7 +231,7 @@ jobs:
231231
${{ env.TAG_PATTERNS }}
232232
233233
- name: Build and push
234-
uses: docker/build-push-action@14487ce63c7a62a4a324b0bfb37086795e31c6c1 # v6
234+
uses: docker/build-push-action@14487ce63c7a62a4a324b0bfb37086795e31c6c1 # v6.16.0
235235
with:
236236
context: .
237237
platforms: linux/amd64,linux/arm64
@@ -276,7 +276,7 @@ jobs:
276276
type=pep440,pattern={{ version }},value=${{ fromJson(inputs.plan).announcement_tag }}
277277
type=pep440,pattern={{ major }}.{{ minor }},value=${{ fromJson(inputs.plan).announcement_tag }}
278278
279-
- uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3
279+
- uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
280280
with:
281281
registry: ghcr.io
282282
username: ${{ github.repository_owner }}

.github/workflows/ci.yaml

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -239,11 +239,11 @@ jobs:
239239
- name: "Install mold"
240240
uses: rui314/setup-mold@e16410e7f8d9e167b74ad5697a9089a35126eb50 # v1
241241
- name: "Install cargo nextest"
242-
uses: taiki-e/install-action@86c23eed46c17b80677df6d8151545ce3e236c61 # v2
242+
uses: taiki-e/install-action@83254c543806f3224380bf1001d6fac8feaf2d0b # v2
243243
with:
244244
tool: cargo-nextest
245245
- name: "Install cargo insta"
246-
uses: taiki-e/install-action@86c23eed46c17b80677df6d8151545ce3e236c61 # v2
246+
uses: taiki-e/install-action@83254c543806f3224380bf1001d6fac8feaf2d0b # v2
247247
with:
248248
tool: cargo-insta
249249
- name: ty mdtests (GitHub annotations)
@@ -297,11 +297,11 @@ jobs:
297297
- name: "Install mold"
298298
uses: rui314/setup-mold@e16410e7f8d9e167b74ad5697a9089a35126eb50 # v1
299299
- name: "Install cargo nextest"
300-
uses: taiki-e/install-action@86c23eed46c17b80677df6d8151545ce3e236c61 # v2
300+
uses: taiki-e/install-action@83254c543806f3224380bf1001d6fac8feaf2d0b # v2
301301
with:
302302
tool: cargo-nextest
303303
- name: "Install cargo insta"
304-
uses: taiki-e/install-action@86c23eed46c17b80677df6d8151545ce3e236c61 # v2
304+
uses: taiki-e/install-action@83254c543806f3224380bf1001d6fac8feaf2d0b # v2
305305
with:
306306
tool: cargo-insta
307307
- name: "Run tests"
@@ -324,7 +324,7 @@ jobs:
324324
- name: "Install Rust toolchain"
325325
run: rustup show
326326
- name: "Install cargo nextest"
327-
uses: taiki-e/install-action@86c23eed46c17b80677df6d8151545ce3e236c61 # v2
327+
uses: taiki-e/install-action@83254c543806f3224380bf1001d6fac8feaf2d0b # v2
328328
with:
329329
tool: cargo-nextest
330330
- name: "Run tests"
@@ -407,11 +407,11 @@ jobs:
407407
- name: "Install mold"
408408
uses: rui314/setup-mold@e16410e7f8d9e167b74ad5697a9089a35126eb50 # v1
409409
- name: "Install cargo nextest"
410-
uses: taiki-e/install-action@86c23eed46c17b80677df6d8151545ce3e236c61 # v2
410+
uses: taiki-e/install-action@83254c543806f3224380bf1001d6fac8feaf2d0b # v2
411411
with:
412412
tool: cargo-nextest
413413
- name: "Install cargo insta"
414-
uses: taiki-e/install-action@86c23eed46c17b80677df6d8151545ce3e236c61 # v2
414+
uses: taiki-e/install-action@83254c543806f3224380bf1001d6fac8feaf2d0b # v2
415415
with:
416416
tool: cargo-insta
417417
- name: "Run tests"
@@ -437,7 +437,7 @@ jobs:
437437
- name: "Install Rust toolchain"
438438
run: rustup show
439439
- name: "Install cargo-binstall"
440-
uses: cargo-bins/cargo-binstall@63aaa5c1932cebabc34eceda9d92a70215dcead6 # v1.12.3
440+
uses: cargo-bins/cargo-binstall@13f9d60d5358393bf14644dba56d9f123bc5d595 # v1.12.4
441441
with:
442442
tool: cargo-fuzz@0.11.2
443443
- name: "Install cargo-fuzz"
@@ -504,12 +504,10 @@ jobs:
504504
# Verify that adding a plugin or rule produces clean code.
505505
- run: ./scripts/add_rule.py --name DoTheThing --prefix F --code 999 --linter pyflakes
506506
- run: cargo check
507-
- run: cargo fmt --all --check
508507
- run: |
509508
./scripts/add_plugin.py test --url https://pypi.org/project/-test/0.1.0/ --prefix TST
510509
./scripts/add_rule.py --name FirstRule --prefix TST --code 001 --linter test
511510
- run: cargo check
512-
- run: cargo fmt --all --check
513511

514512
ecosystem:
515513
name: "ecosystem"
@@ -692,7 +690,7 @@ jobs:
692690
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
693691
with:
694692
persist-credentials: false
695-
- uses: cargo-bins/cargo-binstall@63aaa5c1932cebabc34eceda9d92a70215dcead6 # v1.12.3
693+
- uses: cargo-bins/cargo-binstall@13f9d60d5358393bf14644dba56d9f123bc5d595 # v1.12.4
696694
- run: cargo binstall --no-confirm cargo-shear
697695
- run: cargo shear
698696

@@ -908,7 +906,7 @@ jobs:
908906
run: rustup show
909907

910908
- name: "Install codspeed"
911-
uses: taiki-e/install-action@86c23eed46c17b80677df6d8151545ce3e236c61 # v2
909+
uses: taiki-e/install-action@83254c543806f3224380bf1001d6fac8feaf2d0b # v2
912910
with:
913911
tool: cargo-codspeed
914912

.github/workflows/daily_property_tests.yaml

Lines changed: 0 additions & 72 deletions
This file was deleted.

.github/workflows/mypy_primer.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
echo "Project selector: $PRIMER_SELECTOR"
7070
# Allow the exit code to be 0 or 1, only fail for actual mypy_primer crashes/bugs
7171
uvx \
72-
--from="git+https://github.com/hauntsaninja/mypy_primer@4b15cf3b07db69db67bbfaebfffb2a8a28040933" \
72+
--from="git+https://github.com/hauntsaninja/mypy_primer@968b2b61c05f84462d6fcc78d2f5205bbb8b98c2" \
7373
mypy_primer \
7474
--repo ruff \
7575
--type-checker ty \

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ repos:
8080
pass_filenames: false # This makes it a lot faster
8181

8282
- repo: https://github.com/astral-sh/ruff-pre-commit
83-
rev: v0.11.8
83+
rev: v0.11.9
8484
hooks:
8585
- id: ruff-format
8686
- id: ruff
@@ -98,7 +98,7 @@ repos:
9898
# zizmor detects security vulnerabilities in GitHub Actions workflows.
9999
# Additional configuration for the tool is found in `.github/zizmor.yml`
100100
- repo: https://github.com/woodruffw/zizmor-pre-commit
101-
rev: v1.6.0
101+
rev: v1.7.0
102102
hooks:
103103
- id: zizmor
104104

CHANGELOG.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,45 @@
11
# Changelog
22

3+
## 0.11.10
4+
5+
### Preview features
6+
7+
- \[`ruff`\] Implement a recursive check for `RUF060` ([#17976](https://github.com/astral-sh/ruff/pull/17976))
8+
- \[`airflow`\] Enable autofixes for `AIR301` and `AIR311` ([#17941](https://github.com/astral-sh/ruff/pull/17941))
9+
- \[`airflow`\] Apply try catch guard to all `AIR3` rules ([#17887](https://github.com/astral-sh/ruff/pull/17887))
10+
- \[`airflow`\] Extend `AIR311` rules ([#17913](https://github.com/astral-sh/ruff/pull/17913))
11+
12+
### Bug fixes
13+
14+
- \[`flake8-bugbear`\] Ignore `B028` if `skip_file_prefixes` is present ([#18047](https://github.com/astral-sh/ruff/pull/18047))
15+
- \[`flake8-pie`\] Mark autofix for `PIE804` as unsafe if the dictionary contains comments ([#18046](https://github.com/astral-sh/ruff/pull/18046))
16+
- \[`flake8-simplify`\] Correct behavior for `str.split`/`rsplit` with `maxsplit=0` (`SIM905`) ([#18075](https://github.com/astral-sh/ruff/pull/18075))
17+
- \[`flake8-simplify`\] Fix `SIM905` autofix for `rsplit` creating a reversed list literal ([#18045](https://github.com/astral-sh/ruff/pull/18045))
18+
- \[`flake8-use-pathlib`\] Suppress diagnostics for all `os.*` functions that have the `dir_fd` parameter (`PTH`) ([#17968](https://github.com/astral-sh/ruff/pull/17968))
19+
- \[`refurb`\] Mark autofix as safe only for number literals (`FURB116`) ([#17692](https://github.com/astral-sh/ruff/pull/17692))
20+
21+
### Rule changes
22+
23+
- \[`flake8-bandit`\] Skip `S608` for expressionless f-strings ([#17999](https://github.com/astral-sh/ruff/pull/17999))
24+
- \[`flake8-pytest-style`\] Don't recommend `usefixtures` for `parametrize` values (`PT019`) ([#17650](https://github.com/astral-sh/ruff/pull/17650))
25+
- \[`pyupgrade`\] Add `resource.error` as deprecated alias of `OSError` (`UP024`) ([#17933](https://github.com/astral-sh/ruff/pull/17933))
26+
27+
### CLI
28+
29+
- Disable jemalloc on Android ([#18033](https://github.com/astral-sh/ruff/pull/18033))
30+
31+
### Documentation
32+
33+
- Update Neovim setup docs ([#18108](https://github.com/astral-sh/ruff/pull/18108))
34+
- \[`flake8-simplify`\] Add fix safety section (`SIM103`) ([#18086](https://github.com/astral-sh/ruff/pull/18086))
35+
- \[`flake8-simplify`\] Add fix safety section (`SIM112`) ([#18099](https://github.com/astral-sh/ruff/pull/18099))
36+
- \[`pylint`\] Add fix safety section (`PLC0414`) ([#17802](https://github.com/astral-sh/ruff/pull/17802))
37+
- \[`pylint`\] Add fix safety section (`PLE4703`) ([#17824](https://github.com/astral-sh/ruff/pull/17824))
38+
- \[`pylint`\] Add fix safety section (`PLW1514`) ([#17932](https://github.com/astral-sh/ruff/pull/17932))
39+
- \[`pylint`\] Add fix safety section (`PLW3301`) ([#17878](https://github.com/astral-sh/ruff/pull/17878))
40+
- \[`ruff`\] Add fix safety section (`RUF007`) ([#17755](https://github.com/astral-sh/ruff/pull/17755))
41+
- \[`ruff`\] Add fix safety section (`RUF033`) ([#17760](https://github.com/astral-sh/ruff/pull/17760))
42+
343
## 0.11.9
444

545
### Preview features

CONTRIBUTING.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
Welcome! We're happy to have you here. Thank you in advance for your contribution to Ruff.
44

5+
> [!NOTE]
6+
>
7+
> This guide is for Ruff. If you're looking to contribute to ty, please see [the ty contributing
8+
> guide](https://github.com/astral-sh/ruff/blob/main/crates/ty/CONTRIBUTING.md).
9+
510
## The Basics
611

712
Ruff welcomes contributions in the form of pull requests.

0 commit comments

Comments
 (0)