630 Commits
Author SHA1 Message Date
astral-automations-bot[bot]andBrent Westbrook ba65abf8ba Bump version to 0.17.3 (#29745)
Co-authored-by: astral-automations-bot[bot] <305554984+astral-automations-bot[bot]@users.noreply.github.com>
Co-authored-by: Brent Westbrook <36778786+ntBre@users.noreply.github.com>
2026-10-26 20:14:27 -04:00
Charlie Marsh 5e90790d11 Compute the lexer keyword hash at compile time (#29677)
## Summary

Changing the lexer's keyword set now takes one edit to the Rust list.
The compiler finds a collision-free multiplier and builds the 64-slot
table, so we can remove the Python generator and its lockfile.

A two-byte keyword like `if` packs to `0x6669_0000_0000_0000`. Only the
low two bytes of the multiplier affect its slot. We place keywords from
shortest to longest, choosing each new byte of the multiplier without
disturbing the shorter keywords. The lexer still selects a slot with one
multiply and shift, then compares the full word.
2026-10-23 15:29:49 -04:00
Charlie Marsh de9d86e245 Speed up identifier and keyword lexing (#29463)
## Summary

We scan ASCII identifier continuations in sixteen-byte batches using a
byte lookup table, avoiding per-character decoding. Keyword lookup
filters by length and initial byte, then uses a compact hash table with
a full-word comparison to reject collisions. Non-ASCII suffixes retain
the existing Unicode path.
2026-10-23 13:58:33 -04:00
Zanie Blueandzaniebot b5968c8a8d Omit the report ZIP link when HTML is available (#29661)
Report comments include a redundant ZIP download link after the hosted
HTML links. Show the ZIP link only when the HTML report is unavailable,
including when its upload fails.

Co-authored-by: zaniebot <242828183+zaniebot@users.noreply.github.com>
2026-10-22 17:00:29 -07:00
dependabot[bot] 0e190851d3 Bump black from 26.3.1 to 26.10.1 in /scripts/benchmarks (#29657)
Signed-off-by: dependabot[bot] <support@github.com>
2026-10-22 23:25:25 +00:00
7fab688f61 [ty] Host ecosystem reports from pull requests (#29625)
ty ecosystem comments currently require downloading a ZIP to view the
full reports. Add an optional `upload-html` mode to the shared report
publisher and enable it for ty, linking directly to the diagnostic diff
and timing results while retaining the downloadable artifact.

The publisher runs from `main`, uses STS for GitHub credentials, and
obtains temporary AWS upload credentials through GitHub OIDC when
hosting is enabled. Each caller supplies filenames and content types,
with optional link labels. The publisher reads only those files from a
bounded archive without extracting or executing them during publication,
and stores reports under separate paths for each PR, report, run, and
attempt. If an upload fails, the publisher still attempts to post the
summary and, when available, the artifact link.

The `automations` environment requires `REPORTS_BUCKET`, `REPORTS_URL`,
`REPORTS_ROLE_ARN`, and `REPORTS_REGION` from the report hosting
infrastructure.

---------

Co-authored-by: Zanie Blue <2586601+zanieb@users.noreply.github.com>
Co-authored-by: zaniebot <242828183+zaniebot@users.noreply.github.com>
2026-10-22 22:44:25 +00:00
astral-automations-bot[bot]andBrent Westbrook 30516b42ab Bump version to 0.17.2 (#29637)
Co-authored-by: astral-automations-bot[bot] <305554984+astral-automations-bot[bot]@users.noreply.github.com>
Co-authored-by: Brent Westbrook <36778786+ntBre@users.noreply.github.com>
2026-10-22 13:54:24 -04:00
Zanie Blueandzaniebot ec891bab3b Link the commit in pull request report footers (#29621)
The report footer renders the commit SHA as code, so it is not
clickable. Link the commit, label it as the revision the results
describe, and separate the footer from the report.

---------

Co-authored-by: zaniebot <242828183+zaniebot@users.noreply.github.com>
2026-10-21 23:22:03 -07:00
Zanie Blueandzaniebot ad83e52a22 Add a shared pull request report publisher (#29603)
Add `publish-pull-request-report.yml` as a shared publisher for
automation reports, using STS for GitHub writes and the KV actions for
comment IDs. Store IDs in `pull-request` scope so later runs can update
the same report.

Look up each stored ID directly and verify the bot, PR, marker, and run
metadata. When a report is published, missing or expired keys create a
new comment without scanning existing comments; deleted comments are
replaced. Malformed IDs, IDs belonging to another comment, and KV errors
fail the job. The publisher verifies the source run and current PR head
before writing; report workflows enable it separately.

---------

Co-authored-by: zaniebot <242828183+zaniebot@users.noreply.github.com>
2026-10-21 22:49:24 -07:00
Zanie Blueandzaniebot 332cacc6a3 Move pull request reviewer selection to GitHub Actions (#29613)
Move reviewer selection from `astral-bot` into a serialized Actions
worker triggered by Ruff's dispatch policy. The worker uses the
repository's reviewer pools and requests reviews as
`astral-automations-bot[bot]` using STS. Store round-robin credits in
`workflow` scope, with read and write access restricted to
`pull-request-reviewers.yml` on `main` in the `automations` environment.
When no reviewer state is stored, credits start at zero.

---------

Co-authored-by: zaniebot <242828183+zaniebot@users.noreply.github.com>
2026-10-21 22:32:14 -07:00
renovate[bot] 5bf63e4c10 Update dependency pyrefly to v1.3.1 (#29564)
This PR contains the following updates:

| Package | Change |
[Age](https://docs.renovatebot.com/merge-confidence/) |
[Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| pyrefly | `==1.3.0` → `==1.3.1` |
![age](https://developer.mend.io/api/mc/badges/age/pypi/pyrefly/1.3.1?slim=true)
|
![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/pyrefly/1.3.0/1.3.1?slim=true)
|

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - "before 4am on Wednesday"
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/astral-sh/ruff).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xNzEuMiIsInVwZGF0ZWRJblZlciI6IjQ0LjE3MS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJpbnRlcm5hbCJdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-10-20 19:43:15 -07:00
David Peter c64734bcea [ty] Enable return type inference in scripts and tools (#29439)
## Summary

Enable return type inference for all 24 standalone Python scripts
checked by ty in CI, along with `py-fuzzer` and `ty_benchmark`.
2026-10-16 12:41:30 +00:00
Zanie Blueandzaniebot c79af46103 Require hashes for build dependencies (#29336)
Enable `require-build-hashes` for the Python projects and inline scripts
so isolated builds require declared hashes for their build dependencies.
Pin the build backends and their dependencies with hashes.

---------

Co-authored-by: zaniebot <242828183+zaniebot@users.noreply.github.com>
2026-10-15 20:15:23 +01:00
astral-automations-bot[bot] 4683270c69 Bump version to 0.17.1 (#29420)
Co-authored-by: astral-automations-bot[bot] <305554984+astral-automations-bot[bot]@users.noreply.github.com>
2026-10-15 10:56:41 -04:00
renovate[bot] ab433b1e2b Update dependency pyright to v1.1.414 (#29349)
This PR contains the following updates:

| Package | Change |
[Age](https://docs.renovatebot.com/merge-confidence/) |
[Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [pyright](https://redirect.github.com/Microsoft/pyright)
([source](https://redirect.github.com/Microsoft/pyright/tree/HEAD/packages/pyright))
| [`1.1.413` →
`1.1.414`](https://renovatebot.com/diffs/npm/pyright/1.1.413/1.1.414) |
![age](https://developer.mend.io/api/mc/badges/age/npm/pyright/1.1.414?slim=true)
|
![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/pyright/1.1.413/1.1.414?slim=true)
|

---

### Release Notes

<details>
<summary>Microsoft/pyright (pyright)</summary>

###
[`v1.1.414`](https://redirect.github.com/microsoft/pyright/releases/tag/1.1.414):
Published 1.1.414

[Compare
Source](https://redirect.github.com/Microsoft/pyright/compare/1.1.413...1.1.414)

#### Changes:

-
[`a28cce4`](https://redirect.github.com/Microsoft/pyright/commit/a28cce4077d87b80bead12de809f79845e39c8ba)
Bump version to 1.1.414
([#&#8203;11724](https://redirect.github.com/Microsoft/pyright/issues/11724))
-
[`10f9e77`](https://redirect.github.com/Microsoft/pyright/commit/10f9e773c012d3ae15fd3232915a86ffda64d371)
Bump the github-actions group across 1 directory with 5 updates
([#&#8203;11720](https://redirect.github.com/Microsoft/pyright/issues/11720))
-
[`d72e2fe`](https://redirect.github.com/Microsoft/pyright/commit/d72e2fe89e4ad4227d6c5be9bb6e57b082768e23)
Fix pnpm setup in benchmark workflow
([#&#8203;11719](https://redirect.github.com/Microsoft/pyright/issues/11719))
-
[`854df36`](https://redirect.github.com/Microsoft/pyright/commit/854df36c470a636ca44fbf222ea7d4f328f5f471)
Allow assigning signature metadata to functions
([#&#8203;11714](https://redirect.github.com/Microsoft/pyright/issues/11714))
-
[`c773932`](https://redirect.github.com/Microsoft/pyright/commit/c77393240247e017db6538d35876e723c518e06c)
Publish pyright-typeserver to npm
([#&#8203;11713](https://redirect.github.com/Microsoft/pyright/issues/11713))
-
[`fa9b200`](https://redirect.github.com/Microsoft/pyright/commit/fa9b200906fadc093e862ce62ec1afa985c7233d)
Pull Pylance with Pyright 1.1.413
([#&#8203;11697](https://redirect.github.com/Microsoft/pyright/issues/11697))
-
[`e690634`](https://redirect.github.com/Microsoft/pyright/commit/e690634a94ab05cf7dd003b63b1ac67cd6d6878e)
Fix printExpression output for slice expressions and set displays
([#&#8203;11598](https://redirect.github.com/Microsoft/pyright/issues/11598))
-
[`685de39`](https://redirect.github.com/Microsoft/pyright/commit/685de39b5d3f32092fb576c9de54e5472a28447d)
Report a specific diagnostic for walrus in a comprehension iterable
([#&#8203;11606](https://redirect.github.com/Microsoft/pyright/issues/11606))
\[
[#&#8203;11514](https://redirect.github.com/Microsoft/pyright/issues/11514)
]
-
[`5a958ca`](https://redirect.github.com/Microsoft/pyright/commit/5a958ca8f5119affaca3c6cfe2157cdc87480f0a)
Add regression tests for sentinel conditional type guards
([#&#8203;11686](https://redirect.github.com/Microsoft/pyright/issues/11686))
-
[`6a7d491`](https://redirect.github.com/Microsoft/pyright/commit/6a7d491300be1fe1c2328fb64b511f7e2a4b356a)
Preserve benchmark result comments
([#&#8203;11682](https://redirect.github.com/Microsoft/pyright/issues/11682))

<details><summary><b>See More</b></summary>

-
[`8575d83`](https://redirect.github.com/Microsoft/pyright/commit/8575d8332f73f96721987e373f9844a666446b94)
Fix Sentinel base type assignability
([#&#8203;11676](https://redirect.github.com/Microsoft/pyright/issues/11676))
-
[`37c0386`](https://redirect.github.com/Microsoft/pyright/commit/37c03866d7929e4745e802c37e7e9bcabeda080b)
Optimize type equality fast paths
([#&#8203;11420](https://redirect.github.com/Microsoft/pyright/issues/11420))
-
[`b8dd159`](https://redirect.github.com/Microsoft/pyright/commit/b8dd159d12ff7e99ad8e8854737ce21e9ecb7042)
Fix keyword-form assignability for standard dest parameters
([#&#8203;11670](https://redirect.github.com/Microsoft/pyright/issues/11670))
-
[`bf6ec03`](https://redirect.github.com/Microsoft/pyright/commit/bf6ec03650710f7dc34fcf42442e6590d960f5cb)
Fix benchmark comparison and reporting
([#&#8203;11680](https://redirect.github.com/Microsoft/pyright/issues/11680))
-
[`390f0aa`](https://redirect.github.com/Microsoft/pyright/commit/390f0aaa54fb0d6f17725a7f999e2457079b3bcb)
Fix TypeGuard and TypeIs narrowing for functions with union return types
([#&#8203;11608](https://redirect.github.com/Microsoft/pyright/issues/11608))
-
[`fabb9f9`](https://redirect.github.com/Microsoft/pyright/commit/fabb9f9f9005c1180a108cac1bb7daf9d1bb0721)
Fix type narrowing for equality comparisons with IntEnum and StrEnum
values
([#&#8203;11622](https://redirect.github.com/Microsoft/pyright/issues/11622))
-
[`20380f2`](https://redirect.github.com/Microsoft/pyright/commit/20380f21f4afe7db79dd4dd7d3e31ab7a6ca4c24)
Push Pylance changes to Pyright
([#&#8203;11678](https://redirect.github.com/Microsoft/pyright/issues/11678))
-
[`3a1e14d`](https://redirect.github.com/Microsoft/pyright/commit/3a1e14df628d4e7454be3bc46ce0f8be672c08fd)
Benchmark pull request merge commits
([#&#8203;11677](https://redirect.github.com/Microsoft/pyright/issues/11677))
-
[`d5162f9`](https://redirect.github.com/Microsoft/pyright/commit/d5162f944f9a565549939eb4dc87934c2f170689)
Cover two remaining dataclass field() override branches
([#&#8203;11679](https://redirect.github.com/Microsoft/pyright/issues/11679))
\[
[#&#8203;11665](https://redirect.github.com/Microsoft/pyright/issues/11665)
]
-
[`0b8c227`](https://redirect.github.com/Microsoft/pyright/commit/0b8c227baf95bae353ce9268336ea09d912cd728)
Fix crashes after clearing analyzer caches
([#&#8203;11675](https://redirect.github.com/Microsoft/pyright/issues/11675))
-
[`b895058`](https://redirect.github.com/Microsoft/pyright/commit/b89505828a17ce2a75df68419eaf10ab9707104d)
Do not inherit dataclass defaults when a subclass uses field() without
one.
([#&#8203;11665](https://redirect.github.com/Microsoft/pyright/issues/11665))
\[
[#&#8203;11660](https://redirect.github.com/Microsoft/pyright/issues/11660)
]
-
[`99854b7`](https://redirect.github.com/Microsoft/pyright/commit/99854b716017afd28e79e61e3904834e0fcbe854)
Dispatch typecheck benchmark workflow directly
([#&#8203;11674](https://redirect.github.com/Microsoft/pyright/issues/11674))
-
[`1be1899`](https://redirect.github.com/Microsoft/pyright/commit/1be1899ebec8591346b64a388ec195298e78f44e)
Do not treat objects with explicit **iter** as iterable via **getitem**.
([#&#8203;11645](https://redirect.github.com/Microsoft/pyright/issues/11645))
-
[`beaac8f`](https://redirect.github.com/Microsoft/pyright/commit/beaac8f2f965a4b27bfb1f958392254fcf86b11e)
Fix functools.partial type evaluation for callable class instances
([#&#8203;11672](https://redirect.github.com/Microsoft/pyright/issues/11672))
-
[`5b448bb`](https://redirect.github.com/Microsoft/pyright/commit/5b448bb99ddee5084ad51e1f7c4eb48455cc492c)
Do not eliminate a TypedDict with extra items on a negative key check
([#&#8203;11663](https://redirect.github.com/Microsoft/pyright/issues/11663))
-
[`bacb814`](https://redirect.github.com/Microsoft/pyright/commit/bacb8141b4e93fe2583db032a5318f42aa3a75e9)
Fix benchmark comment trigger
([#&#8203;11673](https://redirect.github.com/Microsoft/pyright/issues/11673))
-
[`93a6550`](https://redirect.github.com/Microsoft/pyright/commit/93a6550b2acc61d930edf54ad4621638cdc70777)
Add cross-type-checker benchmark regression tracking
([#&#8203;11574](https://redirect.github.com/Microsoft/pyright/issues/11574))
-
[`85837ef`](https://redirect.github.com/Microsoft/pyright/commit/85837efea752fbb1cd04c261a51cded566e21e57)
Add non-publishing registry validation mode
([#&#8203;11667](https://redirect.github.com/Microsoft/pyright/issues/11667))
-
[`3f87071`](https://redirect.github.com/Microsoft/pyright/commit/3f870712c2a2076ccfbfe685c3dbda7a453a590a)
Install pinned pnpm on Azure DevOps build agents
([#&#8203;11661](https://redirect.github.com/Microsoft/pyright/issues/11661))
\[
[#&#8203;11652](https://redirect.github.com/Microsoft/pyright/issues/11652)
]
-
[`d5e77a7`](https://redirect.github.com/Microsoft/pyright/commit/d5e77a7f4856f8e7caee1fa788b25bf67901a3c9)
Fix protocol cache for specialized self overloads
([#&#8203;11649](https://redirect.github.com/Microsoft/pyright/issues/11649))
-
[`7ddd3b1`](https://redirect.github.com/Microsoft/pyright/commit/7ddd3b121bf3421fd3e98ec4f3b38209e24c08d0)
Push Pylance changes to Pyright
([#&#8203;11658](https://redirect.github.com/Microsoft/pyright/issues/11658))
-
[`5cf4afa`](https://redirect.github.com/Microsoft/pyright/commit/5cf4afa88b491795af0a2bfd1683ec24c60dcf03)
Migrate CI package installation to pnpm
([#&#8203;11652](https://redirect.github.com/Microsoft/pyright/issues/11652))
-
[`334e3fb`](https://redirect.github.com/Microsoft/pyright/commit/334e3fb792f7b912a44715e74528fab22b73bf1e)
Pin GitHub Actions to full-length commit SHAs
([#&#8203;11628](https://redirect.github.com/Microsoft/pyright/issues/11628))

This list of changes was [auto
generated](https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=15264113\&view=logs).</details>

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - "before 4am on Wednesday"
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/astral-sh/ruff).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xNTUuMiIsInVwZGF0ZWRJblZlciI6IjQ0LjE1NS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJpbnRlcm5hbCJdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-10-14 08:05:39 +01:00
renovate[bot] 518d03e379 Update dependency pyrefly to v1.3.0 (#29357)
This PR contains the following updates:

| Package | Change |
[Age](https://docs.renovatebot.com/merge-confidence/) |
[Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| pyrefly | `==1.2.0` → `==1.3.0` |
![age](https://developer.mend.io/api/mc/badges/age/pypi/pyrefly/1.3.0?slim=true)
|
![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/pyrefly/1.2.0/1.3.0?slim=true)
|

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - "before 4am on Wednesday"
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/astral-sh/ruff).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xNTUuMiIsInVwZGF0ZWRJblZlciI6IjQ0LjE1NS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJpbnRlcm5hbCJdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-10-14 08:04:29 +01:00
Charlie Marsh a5aee680b1 Use thin LTO for PGO training (#29271)
## Summary

Use thin LTO for the instrumented release executable in the PGO build,
while keeping fat LTO for the final executable. Pass the override
through `cargo rustc` so dependency compilation and the workspace's
release profile are unchanged. Debug builds are unchanged.

This reduces the estimated PGO pipeline time by 54% in a Linux x86-64
comparison, with essentially unchanged final binary size and no
consistent runtime regression across the holdout projects used for the
original PGO work in #27570.

## Build results

| Measurement | Fat training | Thin training |
| --- | ---: | ---: |
| Instrumented build | 487.86 s | 85.50 s |
| Final fat-LTO build, median | 247.75 s | 250.43 s |
| Estimated complete PGO pipeline | 738.02 s | 338.26 s |
| Final stripped executable, median | 22.719 MiB | 22.724 MiB |

Instrumented builds were measured once per mode. Final build times and
sizes are medians of three independently collected profiles per mode.
Pipeline estimates add the instrumented build, median training and
profile merge, and median final build; corpus downloads are excluded.
These are clean local build measurements, not CI timing predictions.

## Runtime results

We trained on the canonical 618-file corpus and evaluated linting and
formatting on Django, pandas, scikit-learn, SciPy, and SymPy, whose
repositories are disjoint from the training corpus. The holdout pins
come from the contemporaneous Windows follow-up in #27573, since the
initial Linux PR did not record exact holdout revisions.

Each case used three independent profile pairs and 12 interleaved
fat/thin timing pairs per profile, for 720 timed runs in total. Runs
used eight pinned CPUs and eight threads, with balanced execution order
and warm caches. Diagnostics and formatting diffs were checked
separately from the quiet timed commands and matched across all six
final binaries.

Positive changes below mean thin training was slower. Intervals are
per-workload hierarchical bootstrap 95% confidence intervals, resampling
profile pairs and then paired timing observations; they are not adjusted
for multiple comparisons.

| Holdout | CPU change (95% CI) | Wall change (95% CI) |
| --- | ---: | ---: |
| Django lint | -0.21% [-0.77%, +0.49%] | +0.10% [-1.41%, +1.29%] |
| Django format | -0.10% [-1.18%, +0.72%] | -0.27% [-1.37%, +1.45%] |
| pandas lint | -0.01% [-0.45%, +0.39%] | -0.67% [-2.49%, +1.26%] |
| pandas format | -0.26% [-1.10%, +0.67%] | -0.84% [-2.81%, +2.12%] |
| scikit-learn lint | +0.02% [-0.62%, +1.12%] | -0.02% [-1.11%, +1.86%]
|
| scikit-learn format | -0.52% [-2.14%, +0.62%] | -0.79% [-2.08%,
+1.03%] |
| SciPy lint | -0.21% [-0.70%, +0.43%] | -0.64% [-4.59%, +1.52%] |
| SciPy format | -0.52% [-1.03%, +0.13%] | -2.47% [-6.20%, +1.61%] |
| SymPy lint | +0.01% [-0.30%, +0.27%] | -0.77% [-3.23%, +0.88%] |
| SymPy format | -0.18% [-1.89%, +1.84%] | -0.58% [-3.58%, +3.30%] |

A longer SymPy formatting repeat with the same three profile pairs and
48 timing pairs per profile measured -0.18% CPU [-1.96%, +1.66%] and
-0.28% wall time [-2.19%, +1.58%]. Individual profiles varied in both
directions, so the near-flat average should not be interpreted as
identical performance for every trained binary. The pandas formatting
wall-time interval remains inconclusive at a 2% slowdown threshold.

All six profiles had matching function/CFG identities and counter
layouts, with no missing-profile or profile-mismatch compiler
diagnostics. Their counter values and `.profdata` bytes were not
identical.

Measurements used the Rust/Cargo source at
`7c6f8fc8fc5655dfa47e125b05453007b9e7a6c7`, the standard release
codegen-unit settings, and Ohm Rust 1.99.0-dev (`08bbd755a`, LLVM
23.1.1) with experimental defaults disabled. The benchmark was not rerun
on this PR's newer base revision. This is an exploratory Linux x86-64
study with three profiles per mode, not a guarantee of zero runtime cost
or equivalent results on macOS, Windows, or ARM.
2026-10-10 08:26:15 -04:00
astral-automations-bot[bot]andBrent Westbrook 5b27c1ccfa Bump version to 0.17.0 (#29259)
Co-authored-by: astral-automations-bot[bot] <305554984+astral-automations-bot[bot]@users.noreply.github.com>
Co-authored-by: Brent Westbrook <brentrwestbrook@gmail.com>
2026-10-09 13:45:29 -04:00
David Peter d1d6a5d4ae [ty] Upgrade hyperfine to 2.0.0 for benchmarks (#29219)
Follow-up to #29151: upgrade the benchmark dependency from hyperfine
2.0.0-alpha.2 to 2.0.0.

Use `--env RAYON_NUM_THREADS=1` instead of an `env` command prefix for
the single-threaded formatter benchmarks. This avoids measuring the
overhead of `env` itself (~5 ms).
2026-10-08 13:34:20 +02:00
David Peter db2a4a9216 [ty] Upgrade hyperfine to 2.0.0-alpha.2 for benchmarks (#29151)
## Summary

Upgrade hyperfine to 2.0.0-alpha.2, which now includes support for
memory measurements (see output below).

Tested:

<details>
<summary>Formatter benchmark output</summary>

```text
Benchmark 1: ./target/release/ruff format ./fixture (2 runs)
                mean     ±       σ          min     …     max
  Wall Time     12.8 ms  ±     0.2 ms      12.7 ms  …    12.9 ms
  Memory        16.6 MiB ±     0.1 MiB     16.5 MiB …    16.6 MiB
 
Benchmark 2: black --no-cache ./fixture --safe (2 runs)
                mean     ±       σ          min     …     max
  Wall Time    207.1 ms  ±     4.8 ms     203.7 ms  …   210.5 ms         +1517.9%  (16.2x slower)
  Memory        37.3 MiB ±     0.1 MiB     37.2 MiB …    37.4 MiB         +125.2%  (2.3x more)
 
Benchmark 3: black --no-cache ./fixture --fast (2 runs)
                mean     ±       σ          min     …     max
  Wall Time    226.6 ms  ±     7.4 ms     221.4 ms  …   231.9 ms         +1670.7%  (17.7x slower)
  Memory        37.4 MiB ±     0.1 MiB     37.3 MiB …    37.5 MiB         +126.2%  (2.3x more)
 
Benchmark 4: black --no-cache ./fixture --safe --preview (2 runs)
                mean     ±       σ          min     …     max
  Wall Time    250.1 ms  ±    41.8 ms     220.6 ms  …   279.6 ms         +1854.3%  (19.5x slower)
  Memory        37.4 MiB ±     0.3 MiB     37.2 MiB …    37.6 MiB         +126.0%  (2.3x more)
 
Benchmark 5: black --no-cache ./fixture --fast --preview (2 runs)
                mean     ±       σ          min     …     max
  Wall Time    186.2 ms  ±     2.5 ms     184.5 ms  …   188.0 ms         +1355.1%  (14.6x slower)
  Memory        37.3 MiB ±     0.0 MiB     37.3 MiB …    37.3 MiB         +125.2%  (2.3x more)
 
Benchmark 6: autopep8 ./fixture --recursive --in-place (2 runs)
                mean     ±       σ          min     …     max
  Wall Time     41.6 ms  ±     0.7 ms      41.1 ms  …    42.1 ms          +225.2%  (3.3x slower)
  Memory        26.3 MiB ±     0.0 MiB     26.3 MiB …    26.3 MiB          +58.8%  (1.6x more)
 
Benchmark 7: yapf ./fixture --parallel --recursive --in-place (2 runs)
                mean     ±       σ          min     …     max
  Wall Time    142.1 ms  ±     4.8 ms     138.7 ms  …   145.5 ms         +1010.6%  (11.1x slower)
  Memory        29.1 MiB ±     0.3 MiB     28.9 MiB …    29.4 MiB          +76.0%  (1.8x more)
 
Benchmark 1: env RAYON_NUM_THREADS=1 ./target/release/ruff format ./fixture (2 runs)
                mean     ±       σ          min     …     max
  Wall Time     12.7 ms  ±     2.5 ms      10.9 ms  …    14.4 ms
  Memory        14.6 MiB ±     0.1 MiB     14.6 MiB …    14.7 MiB
 
Benchmark 2: black --no-cache ./fixture --workers=1 --safe (2 runs)
                mean     ±       σ          min     …     max
  Wall Time     95.2 ms  ±     3.2 ms      92.9 ms  …    97.4 ms          +650.6%  (7.5x slower)
  Memory        38.4 MiB ±     0.0 MiB     38.4 MiB …    38.4 MiB         +162.6%  (2.6x more)
 
Benchmark 3: black --no-cache ./fixture --workers=1 --fast (2 runs)
                mean     ±       σ          min     …     max
  Wall Time     89.6 ms  ±     2.8 ms      87.6 ms  …    91.6 ms          +606.5%  (7.1x slower)
  Memory        38.4 MiB ±     0.0 MiB     38.4 MiB …    38.4 MiB         +162.7%  (2.6x more)
 
Benchmark 4: black --no-cache ./fixture --workers=1 --safe --preview (2 runs)
                mean     ±       σ          min     …     max
  Wall Time     94.7 ms  ±     0.6 ms      94.3 ms  …    95.2 ms          +646.9%  (7.5x slower)
  Memory        38.5 MiB ±     0.1 MiB     38.5 MiB …    38.6 MiB         +163.5%  (2.6x more)
 
Benchmark 5: black --no-cache ./fixture --workers=1 --fast --preview (2 runs)
                mean     ±       σ          min     …     max
  Wall Time     92.7 ms  ±     0.6 ms      92.3 ms  …    93.2 ms          +631.4%  (7.3x slower)
  Memory        38.4 MiB ±     0.1 MiB     38.3 MiB …    38.4 MiB         +162.5%  (2.6x more)
 
Benchmark 6: autopep8 ./fixture --in-place --recursive --jobs=1 (2 runs)
                mean     ±       σ          min     …     max
  Wall Time     43.5 ms  ±     3.7 ms      40.9 ms  …    46.1 ms          +242.7%  (3.4x slower)
  Memory        26.5 MiB ±     0.1 MiB     26.4 MiB …    26.6 MiB          +81.2%  (1.8x more)
 
Benchmark 7: yapf ./fixture --recursive --in-place (2 runs)
                mean     ±       σ          min     …     max
  Wall Time     56.8 ms  ±     1.2 ms      55.9 ms  …    57.6 ms          +347.8%  (4.5x slower)
  Memory        27.3 MiB ±     0.1 MiB     27.2 MiB …    27.4 MiB          +86.5%  (1.9x more)
 
Benchmark 1: ./target/release/ruff format ./fixture --check (2 runs)
                mean     ±       σ          min     …     max
  Wall Time     10.2 ms  ±     0.3 ms       9.9 ms  …    10.4 ms
  Memory        16.9 MiB ±     0.1 MiB     16.8 MiB …    17.0 MiB
 
Benchmark 2: black --no-cache ./fixture --check --safe (2 runs)
                mean     ±       σ          min     …     max
  Wall Time    193.8 ms  ±     6.2 ms     189.5 ms  …   198.2 ms         +1806.9%  (19.1x slower)
  Memory        37.3 MiB ±     0.1 MiB     37.2 MiB …    37.4 MiB         +120.8%  (2.2x more)
 
Benchmark 3: black --no-cache ./fixture --check --fast (2 runs)
                mean     ±       σ          min     …     max
  Wall Time    188.2 ms  ±     1.9 ms     186.8 ms  …   189.6 ms         +1751.4%  (18.5x slower)
  Memory        37.3 MiB ±     0.1 MiB     37.3 MiB …    37.4 MiB         +121.1%  (2.2x more)
 
Benchmark 4: black --no-cache ./fixture --check --safe --preview (2 runs)
                mean     ±       σ          min     …     max
  Wall Time    202.1 ms  ±     6.3 ms     197.7 ms  …   206.6 ms         +1888.5%  (19.9x slower)
  Memory        37.2 MiB ±     0.0 MiB     37.2 MiB …    37.2 MiB         +120.5%  (2.2x more)
 
Benchmark 5: black --no-cache ./fixture --check --fast --preview (2 runs)
                mean     ±       σ          min     …     max
  Wall Time    197.0 ms  ±    20.1 ms     182.8 ms  …   211.2 ms         +1837.8%  (19.4x slower)
  Memory        37.2 MiB ±     0.0 MiB     37.2 MiB …    37.2 MiB         +120.5%  (2.2x more)
 
Benchmark 6: autopep8 ./fixture --recursive --diff (2 runs)
                mean     ±       σ          min     …     max
  Wall Time     38.5 ms  ±     0.1 ms      38.4 ms  …    38.6 ms          +278.4%  (3.8x slower)
  Memory        26.3 MiB ±     0.0 MiB     26.3 MiB …    26.4 MiB          +56.0%  (1.6x more)
 
Benchmark 7: yapf ./fixture --parallel --recursive --quiet (2 runs)
                mean     ±       σ          min     …     max
  Wall Time    144.8 ms  ±     7.4 ms     139.6 ms  …   150.1 ms         +1324.8%  (14.2x slower)
  Memory        29.0 MiB ±     0.2 MiB     28.9 MiB …    29.1 MiB          +71.6%  (1.7x more)
```

</details>

<details>
<summary>ty_benchmark (multi-threaded, then single-threaded)</summary>

```text
jinja
-----

Benchmark 1: ty (2 runs)
                mean     ±       σ          min     …     max
  Wall Time     73.0 ms  ±     5.6 ms      69.0 ms  …    76.9 ms
  Memory       100.1 MiB ±     0.1 MiB    100.0 MiB …   100.2 MiB
 
  Warning: Ignoring non-zero exit code.
 
Benchmark 2: Pyrefly (2 runs)
                mean     ±       σ          min     …     max
  Wall Time    118.3 ms  ±     6.0 ms     114.0 ms  …   122.5 ms           +62.1%  (1.6x slower)
  Memory       130.9 MiB ±     0.2 MiB    130.8 MiB …   131.1 MiB          +30.8%  (1.3x more)
 
  Warning: Ignoring non-zero exit code.
 
Benchmark 3: mypy (2 runs)
                mean     ±       σ          min     …     max
  Wall Time    802.9 ms  ±     8.0 ms     797.2 ms  …   808.6 ms         +1000.2%  (11.0x slower)
  Memory       143.4 MiB ±     0.1 MiB    143.3 MiB …   143.5 MiB          +43.2%  (1.4x more)
 
  Warning: Ignoring non-zero exit code.
 
Benchmark 4: mypy (warm) (2 runs)
                mean     ±       σ          min     …     max
  Wall Time    208.8 ms  ±     5.6 ms     204.9 ms  …   212.7 ms          +186.1%  (2.9x slower)
  Memory        51.9 MiB ±     0.2 MiB     51.8 MiB …    52.0 MiB          -48.2%  (1.9x less)
 
  Warning: Ignoring non-zero exit code.
 
Benchmark 5: Pyright (2 runs)
                mean     ±       σ          min     …     max
  Wall Time   1198.8 ms  ±    12.0 ms    1190.3 ms  …  1207.3 ms         +1542.8%  (16.4x slower)
  Memory       251.6 MiB ±     1.3 MiB    250.7 MiB …   252.5 MiB         +151.3%  (2.5x more)
 
  Warning: Ignoring non-zero exit code.

jinja
-----

Benchmark 1: ty (2 runs)
                mean     ±       σ          min     …     max
  Wall Time    226.1 ms  ±    14.0 ms     216.2 ms  …   236.0 ms
  Memory        84.9 MiB ±     0.2 MiB     84.8 MiB …    85.0 MiB
 
  Warning: Ignoring non-zero exit code.
 
Benchmark 2: Pyrefly (2 runs)
                mean     ±       σ          min     …     max
  Wall Time    210.4 ms  ±     6.9 ms     205.5 ms  …   215.3 ms            -7.0%
  Memory        92.3 MiB ±     0.1 MiB     92.2 MiB …    92.4 MiB           +8.8%
 
  Warning: Ignoring non-zero exit code.
 
Benchmark 3: mypy (2 runs)
                mean     ±       σ          min     …     max
  Wall Time    896.4 ms  ±    88.8 ms     833.7 ms  …   959.2 ms          +296.4%  (4.0x slower)
  Memory       144.3 MiB ±     0.6 MiB    143.9 MiB …   144.7 MiB          +70.0%  (1.7x more)
 
  Warning: Ignoring non-zero exit code.
 
Benchmark 4: mypy (warm) (2 runs)
                mean     ±       σ          min     …     max
  Wall Time    213.0 ms  ±     3.7 ms     210.4 ms  …   215.6 ms            -5.8%
  Memory        51.7 MiB ±     0.1 MiB     51.6 MiB …    51.8 MiB          -39.1%  (1.6x less)
 
  Warning: Ignoring non-zero exit code.
 
Benchmark 5: Pyright (2 runs)
                mean     ±       σ          min     …     max
  Wall Time    981.9 ms  ±    13.0 ms     972.6 ms  …   991.1 ms          +334.2%  (4.3x slower)
  Memory       315.4 MiB ±     5.9 MiB    311.2 MiB …   319.5 MiB         +271.6%  (3.7x more)
 
  Warning: Ignoring non-zero exit code.
```

</details>

I also tested most of the other hyperfine invocations mentioned
somewhere in this repo.
2026-10-07 13:43:40 +00:00
Alex Waygood 8ecfc92734 Check script lockfiles in CI (#29021) 2026-10-02 14:28:56 +01:00
astral-automations-bot[bot]andBrent Westbrook 3265ed1f94 Bump version to 0.16.10 (#29055)
Co-authored-by: astral-automations-bot[bot] <305554984+astral-automations-bot[bot]@users.noreply.github.com>
Co-authored-by: Brent Westbrook <brentrwestbrook@gmail.com>
2026-10-01 13:40:09 -04:00
Alex Waygood f7446a5970 [ty] Update ecosystem pins and refresh script lockfiles (#29017) 2026-09-30 10:38:07 +00:00
David Peter 55c48b1e76 [ty] Enable strict rules for even more projects and scripts (#28980)
## Summary

I found some more scripts / projects that were not using these rules.

## Test strategy

Ran `ty_benchmark` locally
2026-09-29 06:44:29 +02:00
David Peter de9071547c [ty] Enable None-union truthiness checks in Python scripts and tools (#28911)
## Summary

Enable `truthiness-test-of-none-union` in the standalone scripts' inline
configuration and in the `py-fuzzer` and `ty_benchmark` projects,
following #28889.
2026-09-28 11:47:03 +00:00
astral-automations-bot[bot]andBrent Westbrook 0be08a206f Bump version to 0.16.9 (#28882)
Co-authored-by: astral-automations-bot[bot] <305554984+astral-automations-bot[bot]@users.noreply.github.com>
Co-authored-by: Brent Westbrook <36778786+ntBre@users.noreply.github.com>
2026-09-24 16:21:50 -04:00
Alex Waygood d1cbb6f5e2 [ty] Use shallow fetches in primer setup (#28865) 2026-09-24 12:35:47 +00:00
Alex Waygood b4b8d517d1 [ty] Improve ecosystem summary and minimization workflows (#28789) 2026-09-22 19:41:57 +00:00
Alex Waygood 6cde6bfb72 [ty] Generalize receiver binding for wrapped callables (#28725) 2026-09-21 11:23:31 +01:00
William Woodruff 8defe19c5d Use cargo deny for dep enforcement (#28655)
Signed-off-by: William Woodruff <william@yossarian.net>
2026-09-17 13:55:45 -04:00
astral-automations-bot[bot]andBrent Westbrook 62914c4b9b Bump version to 0.16.8 (#28648)
Co-authored-by: astral-automations-bot[bot] <305554984+astral-automations-bot[bot]@users.noreply.github.com>
Co-authored-by: Brent Westbrook <36778786+ntBre@users.noreply.github.com>
2026-09-16 11:31:02 -04:00
renovate[bot] c61deab820 Update dependency pyright to v1.1.413 (#28626) 2026-09-16 08:21:36 +02:00
astral-automations-bot[bot]andBrent Westbrook b5dba861cc Bump version to 0.16.7 (#28496)
Co-authored-by: astral-automations-bot[bot] <305554984+astral-automations-bot[bot]@users.noreply.github.com>
Co-authored-by: Brent Westbrook <36778786+ntBre@users.noreply.github.com>
2026-09-10 13:47:30 -04:00
Ee Durbin c3813a501f add a workflow for preparing releases (#28486)
this is primarily useful for testing the sts token exchange in a
non-load bearing environment ahead of merging #28484
, but may be useful for maintainers :)

`automations` environment has been created and `STS_API_URL` secret set
2026-09-10 10:44:26 -04:00
Micha Reiser 00948c00a6 Remove the "Who’s Using Ruff?" list (#28455)
## Summary

Removes the "Who's using ruff?" list. 

The section was useful when Ruff was young and not well known. Ruff is
now widely used in the ecosystem, so that this list provides diminishing
returns and we also lack a clear guidance on what it takes for a project
to be added.
2026-09-10 09:27:24 -04:00
Alex Waygood cbb1cdc35e [ty] Dogfood more ty rules on our own scripts (#28387) 2026-09-07 10:04:25 +01:00
Zsolt Dollenstein a592ffe132 Embed archive checksums in the shell installer (#28281)
Release archives already have `.sha256` files, but the custom binary
build jobs don't put those hashes in cargo-dist's manifest. The
generated shell installer therefore has no expected archive hashes to
check.

Add a job that imports the built archives' checksums into a local
manifest before cargo-dist generates the installers. Run the helper
through uv with a script lockfile, require a valid sidecar for every
downloaded executable archive, and require the job to succeed before
hosting the release.
2026-09-04 21:29:42 +01:00
Brent Westbrook ec7e6d82d4 Temporarily revert #28283 to recover the 0.16.6 release (#28286)
Summary
--

#28283 changed workflow files while the release was ongoing, breaking
the Announce step:
https://github.com/astral-sh/ruff/actions/runs/33779698936/job/100737492498

I just need to revert this, rerun the failing step, and then restore the
change.

Test Plan
--

Resuming the release
2026-09-03 17:18:15 +00:00
zaniebotandZanie Blue 1047cc20a2 Use centralized crates.io publishing policies (#28285)
Release preparation still directs new crates to the local bootstrap
utility, which requires a crates.io owner token and tracks configured
crates in `.known-crates`. Use `astral-sh/crates-policies` as the source
of truth instead, matching
[astral-sh/uv#20449](https://github.com/astral-sh/uv/pull/20449).
`scripts/release.sh` now runs the shared workspace checker, the
contribution guide points to the central registration process, and the
duplicate setup utility and local crate list are removed.

Co-authored-by: Zanie Blue <contact@zanie.dev>
2026-09-03 11:50:54 -05:00
William Woodruff 04e0f94798 Add a check-lock workflow (#28283)
Signed-off-by: William Woodruff <william@yossarian.net>
2026-09-03 12:38:21 -04:00
Brent Westbrook 22f65a2ab5 Bump 0.16.6 (#28280) 2026-09-03 12:36:42 -04:00
William Woodruff f96c18b8ae Use cargo insta, cargo nextest, cargo codspeed from toolchain (#28210)
Signed-off-by: William Woodruff <william@yossarian.net>
2026-09-01 14:52:34 +00:00
William WoodruffandAlex Waygood 91a07f5e2d Lift cargo-fuzz into astral-dev-toolchain (#28200)
## Summary

Continues #28197 by lifting `cargo-fuzz` into the dev toolchain.

<!-- What's the purpose of the change? What does it do, and why? -->

## Test Plan

NFC, internal only. I confirmed that `./init-fuzzer.sh` still runs as
expected. I'm less positive about the CI changes.

<!-- How was it tested? -->

---------

Signed-off-by: William Woodruff <william@yossarian.net>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2026-08-31 20:34:06 +00:00
William Woodruff da9e283158 Swap cargo shear and hyperfine to the Astral toolchain (#28197)
Signed-off-by: William Woodruff <william@yossarian.net>
2026-08-31 14:19:43 -04:00
Rob Hand 92bb198015 [ty] Align conformance.py counts with upstream (#28132)
## Summary
The upstream https://github.com/python/typing generated html now has a
breakdown of total test cases passing for each typechecker.

These total don't match what the `conformance.py` emits in it's summary:
https://github.com/astral-sh/ruff/pull/28001#issuecomment-5410032559

> The number of fully passing files held steady at 112/136. 

versus 

<img width="235" height="132" alt="image"
src="https://github.com/user-attachments/assets/6af76b8d-9002-4b00-ac87-b55afb0c15f8"
/>

This is because the summary is generated from `TestCase` which track
`ty` diagnostics, if there are no diagnostics because the relevant test
is designed to emit none they are not included in the count.

So instead we also use the full `test_files` to fill in the missing
stats.

NOTE: I have also bumped `CONFORMANCE_SUITE_COMMIT` which brings in some
recent spec related changes (not just version bumps)
 

## Test Plan

`CONFORMANCE_SUITE_COMMIT=cf943ccbea5596ef969eec6e2260097ff697b7ba uv
run --no-project --python 3.12 scripts/conformance.py --old-ty uvx
ty@0.0.75 --new-ty uvx ty@0.0.75 --tests-path ~/dev/typing/conformance`

```md
## [Typing conformance results](https://github.com/python/typing/blob/cf943ccbea5596ef969eec6e2260097ff697b7ba/conformance/)

### No changes detected ✅

<details>
<summary>Current numbers</summary>

<br>
The percentage of diagnostics emitted that were expected errors held steady at <b>97.79%</b>. The percentage of expected errors that received a diagnostic held steady at <b>94.41%</b>. The number of fully passing files held steady at <b>121/145</b>.

</details>
```
2026-08-28 17:20:42 -07:00
Brent Westbrook 947179d7c6 Enable lint.preview and missing default rules in our Ruff config (#28112)
Summary
--

This PR updates our ruff-pre-commit dependency to 0.16.5, which supports
the new category selectors,
and then enables `lint.preview` and the new default categories so that
we can dogfood them on our
code. There were 66 diagnostics initially, which I also fixed or
ignored:

```
28	FURB113 	[ ] repeated-append
12	ASYNC240	[ ] blocking-path-method-in-async-function
 6	RUF105  	[*] noqa-comments
 5	PLW1510 	[ ] subprocess-run-without-check
 3	PLW0108 	[ ] unnecessary-lambda
 2	EXE001  	[ ] shebang-not-executable
 2	RUF039  	[*] unraw-re-pattern
 1	B024    	[ ] abstract-base-class-without-abstract-method
 1	FURB142 	[*] for-loop-set-mutations
 1	PERF102 	[ ] incorrect-dict-iterator
 1	PLC0207 	[*] missing-maxsplit-arg
 1	PLW0127 	[ ] self-assigning-variable
 1	TRY004  	[ ] type-check-without-type-error
 1	PLW0120 	[*] useless-else-on-loop
 1	TRY201  	[ ] verbose-raise
 ```

Of these, I ignored `repeated-append` and `blocking-path-method-in-async-function`. I think they are
still reasonable defaults, just less useful/important in our uses.

0.16.5 also includes https://github.com/astral-sh/ruff-pre-commit/pull/159, so I removed `markdown` from our main `ruff-format` hook, leaving it for the later mdtest formatting stage.

I also had to make a few changes related to config discovery in tests:
- move our cached ecosystem checkouts to `$RUNNER_TEMP` instead of inside of our checkout
- convert some CLI tests to use the `CliTest` helpers
- add `configurationPreference: editorOnly` to some notebook tests

In these cases, our own Ruff settings were being inherited by test code. This likely affects many other tests, but I only updated the obviously failing ones for now. I'm least confident about the notebook tests, but as far as I can tell from the history (https://github.com/astral-sh/ruff/pull/11944, https://github.com/astral-sh/ruff/pull/22810), the specific diagnostics are not the important parts being asserted.

Test Plan
--

CI on this PR
2026-08-28 12:24:36 -04:00
Brent Westbrook 9e4938c4a6 Bump 0.16.5 (#28110) 2026-08-27 12:09:07 -04:00
Brent Westbrook aad0e909ef Allow rules without codes (#28049)
Summary
--

This PR allows adding rules that only belong to categories and only have
names rather than requiring
a linter group and code.

The first non-empty commit uses `Rule::name` instead of
`Rule::noqa_code` throughout the linter tests, causing a huge number of
file renames without changes.

The second commit updates `FixTable` from a mapping of `SecondaryCode ->
(name, fix_count)` to
`DiagnosticId -> (Option<SecondaryCode>, fix_count)`. This doesn't
really change its usage but
involves minor diffs to a substantial number of lines. It also allows us
to drop some of the special
`hashbrown` handling and the `hashbrown` dependency in `ruff_linter`,
which is nice.

The third commit contains the bulk of the change, including the macro
changes needed to support
`map_codes` entries like that for the `pytest-fixture-autouse` rule in
the fourth commit:

```rust
() => rules::ruff::rules::PytestFixtureAutouse,
```

These changes are pretty mechanical overall, just handling cases where
the linter or noqa code could
be missing, which fortunately seemed pretty straightforward in every
case.

The fourth commit takes advantage of these changes to reinstate `RUF076`
as our first purely
`pedantic` rule. I'm happy to drop that if it's too controversial or
opens too many questions about
the previously-removed rule and its code, but I thought it was nice to
have a motivating example. We
moved this rule from `preview` to `removed` because it was too pedantic
for the `RUF` category, even
in preview, so it's exactly the kind of rule we can support now with the
categories.

Finally, the fifth commit updates the contributing docs to reflect that
linters and codes are
optional. This may need to be adjusted if we back out the `RUF076`
change.

Test Plan
--

Existing tests, plus a few new ones for `pytest-fixture-autouse`
2026-08-27 11:26:35 -04:00
Brent WestbrookandMicha Reiser 29c8e5b2d0 Document rule acceptance guidelines (#27910)
Summary
--

This PR includes the contributor-facing documentation for the new
categories, as well as updated
rule acceptance guidelines built atop them.

I think we could also update our rule request template based on some of
these guidelines, but I'll save that for a follow-up once these are
solidified.

Test Plan
--

Future rule requests

---------

Co-authored-by: Micha Reiser <micha@reiser.io>
2026-08-27 11:26:34 -04:00
Brent Westbrook ada87950ea Introduce category selectors (#27666)
## Summary

This PR introduces clippy-style rule categories that can be used
alongside existing linter-based categories in preview. The categories
have a lower `specificity` than linter groups, meaning that `select =
UP` and `ignore = correctness` will not ignore `UP` correctness rules.
In general this leads to more rules being enabled than the alternative
we considered where categories and linter groups had equal precedence,
which makes it seem like a safer default. We can revisit this if it
proves to be unintuitive, or we can add a Cargo-style `priority` field
in the worst case.

I've tried to organize the commits such that this can be reviewed
commit-by-commit and could also be split into multiple PRs. The first
two commits update the `ViolationMetadata` macro to allow providing a
`category` argument and add such arguments for all rules. This part
could be a standalone change without exposing the categories to users
but still depends on reaching consensus on all rule categories. The
second pair of commits allows using the new categories as selectors
alongside existing selectors, including some precedence tests with other
selector types.

This mostly addresses #1774, but there are some sub-issues there to
resolve before closing the issue.

## Test Plan

New CLI tests and a new mdtest suite around rule precedence
2026-08-27 11:26:33 -04:00