Skip to content

Commit 34c21c4

Browse files
committed
Merge remote-tracking branch 'upstream/main' into lazy-scope-lookup
2 parents 2fb6683 + 9d5ecac commit 34c21c4

File tree

799 files changed

+12542
-4558
lines changed

Some content is hidden

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

799 files changed

+12542
-4558
lines changed

.github/workflows/ci.yaml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,12 @@ jobs:
143143
env:
144144
MERGE_BASE: ${{ steps.merge_base.outputs.sha }}
145145
run: |
146-
if git diff --quiet "${MERGE_BASE}...HEAD" -- ':**' \
147-
':!**/*.md' \
148-
':crates/ty_python_semantic/resources/mdtest/**/*.md' \
146+
# NOTE: Do not exclude all Markdown files here, but rather use
147+
# specific exclude patterns like 'docs/**'), because tests for
148+
# 'ty' are written in Markdown.
149+
if git diff --quiet "${MERGE_BASE}...HEAD" -- \
149150
':!docs/**' \
150151
':!assets/**' \
151-
':.github/workflows/ci.yaml' \
152152
; then
153153
echo "changed=false" >> "$GITHUB_OUTPUT"
154154
else
@@ -238,13 +238,13 @@ jobs:
238238
- name: "Install Rust toolchain"
239239
run: rustup show
240240
- name: "Install mold"
241-
uses: rui314/setup-mold@85c79d00377f0d32cdbae595a46de6f7c2fa6599 # v1
241+
uses: rui314/setup-mold@702b1908b5edf30d71a8d1666b724e0f0c6fa035 # v1
242242
- name: "Install cargo nextest"
243-
uses: taiki-e/install-action@c07504cae06f832dc8de08911c9a9c5cddb0d2d3 # v2.56.13
243+
uses: taiki-e/install-action@c99cc51b309eee71a866715cfa08c922f11cf898 # v2.56.19
244244
with:
245245
tool: cargo-nextest
246246
- name: "Install cargo insta"
247-
uses: taiki-e/install-action@c07504cae06f832dc8de08911c9a9c5cddb0d2d3 # v2.56.13
247+
uses: taiki-e/install-action@c99cc51b309eee71a866715cfa08c922f11cf898 # v2.56.19
248248
with:
249249
tool: cargo-insta
250250
- name: ty mdtests (GitHub annotations)
@@ -296,13 +296,13 @@ jobs:
296296
- name: "Install Rust toolchain"
297297
run: rustup show
298298
- name: "Install mold"
299-
uses: rui314/setup-mold@85c79d00377f0d32cdbae595a46de6f7c2fa6599 # v1
299+
uses: rui314/setup-mold@702b1908b5edf30d71a8d1666b724e0f0c6fa035 # v1
300300
- name: "Install cargo nextest"
301-
uses: taiki-e/install-action@c07504cae06f832dc8de08911c9a9c5cddb0d2d3 # v2.56.13
301+
uses: taiki-e/install-action@c99cc51b309eee71a866715cfa08c922f11cf898 # v2.56.19
302302
with:
303303
tool: cargo-nextest
304304
- name: "Install cargo insta"
305-
uses: taiki-e/install-action@c07504cae06f832dc8de08911c9a9c5cddb0d2d3 # v2.56.13
305+
uses: taiki-e/install-action@c99cc51b309eee71a866715cfa08c922f11cf898 # v2.56.19
306306
with:
307307
tool: cargo-insta
308308
- name: "Run tests"
@@ -325,7 +325,7 @@ jobs:
325325
- name: "Install Rust toolchain"
326326
run: rustup show
327327
- name: "Install cargo nextest"
328-
uses: taiki-e/install-action@c07504cae06f832dc8de08911c9a9c5cddb0d2d3 # v2.56.13
328+
uses: taiki-e/install-action@c99cc51b309eee71a866715cfa08c922f11cf898 # v2.56.19
329329
with:
330330
tool: cargo-nextest
331331
- name: "Run tests"
@@ -381,7 +381,7 @@ jobs:
381381
- name: "Install Rust toolchain"
382382
run: rustup show
383383
- name: "Install mold"
384-
uses: rui314/setup-mold@85c79d00377f0d32cdbae595a46de6f7c2fa6599 # v1
384+
uses: rui314/setup-mold@702b1908b5edf30d71a8d1666b724e0f0c6fa035 # v1
385385
- name: "Build"
386386
run: cargo build --release --locked
387387

@@ -406,7 +406,7 @@ jobs:
406406
MSRV: ${{ steps.msrv.outputs.value }}
407407
run: rustup default "${MSRV}"
408408
- name: "Install mold"
409-
uses: rui314/setup-mold@85c79d00377f0d32cdbae595a46de6f7c2fa6599 # v1
409+
uses: rui314/setup-mold@702b1908b5edf30d71a8d1666b724e0f0c6fa035 # v1
410410
- name: "Build tests"
411411
shell: bash
412412
env:
@@ -903,7 +903,7 @@ jobs:
903903
run: rustup show
904904

905905
- name: "Install codspeed"
906-
uses: taiki-e/install-action@c07504cae06f832dc8de08911c9a9c5cddb0d2d3 # v2.56.13
906+
uses: taiki-e/install-action@c99cc51b309eee71a866715cfa08c922f11cf898 # v2.56.19
907907
with:
908908
tool: cargo-codspeed
909909

@@ -936,7 +936,7 @@ jobs:
936936
run: rustup show
937937

938938
- name: "Install codspeed"
939-
uses: taiki-e/install-action@c07504cae06f832dc8de08911c9a9c5cddb0d2d3 # v2.56.13
939+
uses: taiki-e/install-action@c99cc51b309eee71a866715cfa08c922f11cf898 # v2.56.19
940940
with:
941941
tool: cargo-codspeed
942942

.github/workflows/daily_fuzz.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
- name: "Install Rust toolchain"
3939
run: rustup show
4040
- name: "Install mold"
41-
uses: rui314/setup-mold@85c79d00377f0d32cdbae595a46de6f7c2fa6599 # v1
41+
uses: rui314/setup-mold@702b1908b5edf30d71a8d1666b724e0f0c6fa035 # v1
4242
- uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2.8.0
4343
- name: Build ruff
4444
# A debug build means the script runs slower once it gets started,

.github/workflows/sync_typeshed.yaml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ env:
3434
# and which all three workers push to.
3535
UPSTREAM_BRANCH: typeshedbot/sync-typeshed
3636

37+
# The path to the directory that contains the vendored typeshed stubs,
38+
# relative to the root of the Ruff repository.
39+
VENDORED_TYPESHED: crates/ty_vendored/vendor/typeshed
40+
3741
jobs:
3842
# Sync typeshed stubs, and sync all docstrings available on Linux.
3943
# Push the changes to a new branch on the upstream repository.
@@ -64,20 +68,20 @@ jobs:
6468
- uses: astral-sh/setup-uv@bd01e18f51369d5a26f1651c3cb451d3417e3bba # v6.3.1
6569
- name: Sync typeshed stubs
6670
run: |
67-
rm -rf ruff/crates/ty_vendored/vendor/typeshed
68-
mkdir ruff/crates/ty_vendored/vendor/typeshed
69-
cp typeshed/README.md ruff/crates/ty_vendored/vendor/typeshed
70-
cp typeshed/LICENSE ruff/crates/ty_vendored/vendor/typeshed
71+
rm -rf "ruff/${VENDORED_TYPESHED}"
72+
mkdir "ruff/${VENDORED_TYPESHED}"
73+
cp typeshed/README.md "ruff/${VENDORED_TYPESHED}"
74+
cp typeshed/LICENSE "ruff/${VENDORED_TYPESHED}"
7175
7276
# The pyproject.toml file is needed by a later job for the black configuration.
7377
# It's deleted before creating the PR.
74-
cp typeshed/pyproject.toml ruff/crates/ty_vendored/vendor/typeshed
78+
cp typeshed/pyproject.toml "ruff/${VENDORED_TYPESHED}"
7579
76-
cp -r typeshed/stdlib ruff/crates/ty_vendored/vendor/typeshed/stdlib
77-
rm -rf ruff/crates/ty_vendored/vendor/typeshed/stdlib/@tests
78-
git -C typeshed rev-parse HEAD > ruff/crates/ty_vendored/vendor/typeshed/source_commit.txt
80+
cp -r typeshed/stdlib "ruff/${VENDORED_TYPESHED}/stdlib"
81+
rm -rf "ruff/${VENDORED_TYPESHED}/stdlib/@tests"
82+
git -C typeshed rev-parse HEAD > "ruff/${VENDORED_TYPESHED}/source_commit.txt"
7983
cd ruff
80-
git checkout -b typeshedbot/sync-typeshed
84+
git checkout -b "${UPSTREAM_BRANCH}"
8185
git add .
8286
git commit -m "Sync typeshed. Source commit: https://github.com/python/typeshed/commit/$(git -C ../typeshed rev-parse HEAD)" --allow-empty
8387
- name: Sync Linux docstrings
@@ -167,17 +171,17 @@ jobs:
167171
# consistent with the other typeshed stubs around them.
168172
# Typeshed formats code using black in their CI, so we just invoke
169173
# black on the stubs the same way that typeshed does.
170-
uvx black crates/ty_vendored/vendor/typeshed/stdlib --config crates/ty_vendored/vendor/typeshed/pyproject.toml || true
174+
uvx black "${VENDORED_TYPESHED}/stdlib" --config "${VENDORED_TYPESHED}/pyproject.toml" || true
171175
git commit -am "Format codemodded docstrings" --allow-empty
172176
173-
rm crates/ty_vendored/vendor/typeshed/pyproject.toml
177+
rm "${VENDORED_TYPESHED}/pyproject.toml"
174178
git commit -am "Remove pyproject.toml file"
175179
176180
git push
177181
- name: Create a PR
178182
if: ${{ success() }}
179183
run: |
180-
gh pr list --repo "$GITHUB_REPOSITORY" --head typeshedbot/sync-typeshed --json id --jq length | grep 1 && exit 0 # exit if there is existing pr
184+
gh pr list --repo "${GITHUB_REPOSITORY}" --head "${UPSTREAM_BRANCH}" --json id --jq length | grep 1 && exit 0 # exit if there is existing pr
181185
gh pr create --title "[ty] Sync vendored typeshed stubs" --body "Close and reopen this PR to trigger CI" --label "ty"
182186
183187
create-issue-on-failure:

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ repos:
8181
pass_filenames: false # This makes it a lot faster
8282

8383
- repo: https://github.com/astral-sh/ruff-pre-commit
84-
rev: v0.12.3
84+
rev: v0.12.4
8585
hooks:
8686
- id: ruff-format
8787
- id: ruff

CHANGELOG.md

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

3+
## 0.12.4
4+
5+
### Preview features
6+
7+
- \[`flake8-type-checking`, `pyupgrade`, `ruff`\] Add `from __future__ import annotations` when it would allow new fixes (`TC001`, `TC002`, `TC003`, `UP037`, `RUF013`) ([#19100](https://github.com/astral-sh/ruff/pull/19100))
8+
- \[`flake8-use-pathlib`\] Add autofix for `PTH109` ([#19245](https://github.com/astral-sh/ruff/pull/19245))
9+
- \[`pylint`\] Detect indirect `pathlib.Path` usages for `unspecified-encoding` (`PLW1514`) ([#19304](https://github.com/astral-sh/ruff/pull/19304))
10+
11+
### Bug fixes
12+
13+
- \[`flake8-bugbear`\] Fix `B017` false negatives for keyword exception arguments ([#19217](https://github.com/astral-sh/ruff/pull/19217))
14+
- \[`flake8-use-pathlib`\] Fix false negative on direct `Path()` instantiation (`PTH210`) ([#19388](https://github.com/astral-sh/ruff/pull/19388))
15+
- \[`flake8-django`\] Fix `DJ008` false positive for abstract models with type-annotated `abstract` field ([#19221](https://github.com/astral-sh/ruff/pull/19221))
16+
- \[`isort`\] Fix `I002` import insertion after docstring with multiple string statements ([#19222](https://github.com/astral-sh/ruff/pull/19222))
17+
- \[`isort`\] Treat form feed as valid whitespace before a semicolon ([#19343](https://github.com/astral-sh/ruff/pull/19343))
18+
- \[`pydoclint`\] Fix `SyntaxError` from fixes with line continuations (`D201`, `D202`) ([#19246](https://github.com/astral-sh/ruff/pull/19246))
19+
- \[`refurb`\] `FURB164` fix should validate arguments and should usually be marked unsafe ([#19136](https://github.com/astral-sh/ruff/pull/19136))
20+
21+
### Rule changes
22+
23+
- \[`flake8-use-pathlib`\] Skip single dots for `invalid-pathlib-with-suffix` (`PTH210`) on versions >= 3.14 ([#19331](https://github.com/astral-sh/ruff/pull/19331))
24+
- \[`pep8_naming`\] Avoid false positives on standard library functions with uppercase names (`N802`) ([#18907](https://github.com/astral-sh/ruff/pull/18907))
25+
- \[`pycodestyle`\] Handle brace escapes for t-strings in logical lines ([#19358](https://github.com/astral-sh/ruff/pull/19358))
26+
- \[`pylint`\] Extend invalid string character rules to include t-strings ([#19355](https://github.com/astral-sh/ruff/pull/19355))
27+
- \[`ruff`\] Allow `strict` kwarg when checking for `starmap-zip` (`RUF058`) in Python 3.14+ ([#19333](https://github.com/astral-sh/ruff/pull/19333))
28+
29+
### Documentation
30+
31+
- \[`flake8-type-checking`\] Make `TC010` docs example more realistic ([#19356](https://github.com/astral-sh/ruff/pull/19356))
32+
- Make more documentation examples error out-of-the-box ([#19288](https://github.com/astral-sh/ruff/pull/19288),[#19272](https://github.com/astral-sh/ruff/pull/19272),[#19291](https://github.com/astral-sh/ruff/pull/19291),[#19296](https://github.com/astral-sh/ruff/pull/19296),[#19292](https://github.com/astral-sh/ruff/pull/19292),[#19295](https://github.com/astral-sh/ruff/pull/19295),[#19297](https://github.com/astral-sh/ruff/pull/19297),[#19309](https://github.com/astral-sh/ruff/pull/19309))
33+
334
## 0.12.3
435

536
### Preview features

0 commit comments

Comments
 (0)