768 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
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
zaniebotandZanie Blue c23d6967c9 Clarify documentation and correct stale guidance (#29374)
The documentation has stale configuration guidance and a few examples
that do not work as written. Clarify the prose and correct editor
configuration precedence, user-level configuration discovery, rule
descriptions, and the tutorial and configuration examples.

---------

Co-authored-by: Zanie Blue <zanie@openai.com>
2026-10-15 13:36:53 -05: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
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
Brent Westbrook ef23c9c39e Update default and latest Python versions for 3.15 (#28792)
Summary
--

This PR updates our default Python version to 3.11, in line with 3.10
reaching [EOL] next month, and
updates our latest Python version to 3.15. I followed last year's PR
(#20725) to find everywhere
that needed to change. Fortunately there were not as many test changes
needed as last year's
deferred annotation issues.

I also updated the language classifier in our pyproject.toml.

[EOL]: https://devguide.python.org/versions/#supported-versions

Test Plan
--

Existing tests with updated snapshots. Most of the updates were to
snapshots for TC001, TC002, and
TC003, which now default to the lazy-import fix.

After updating the snapshots, I tried to make sure we still had coverage
for whatever changed. That
meant adding a few more mdtests for the TC rules, and one small mdtest
for RUF017 to restore
coverage for the `functools.reduce` fix.
2026-10-09 12:26:57 -04:00
Dhruv Manilawala 97e3bd5875 Update editor docs for removal of ruff-lsp support (#28750)
Update the editor documentation for the VS Code extension's transition
to always using Ruff's native language server.

Remove the retired `ruff-lsp` settings entries, links to those entries,
and obsolete setup notes while retaining migration examples and
replacement guidance. Document `ruff.nativeServer` as deprecated in Ruff
0.17 and describe `ruff.interpreter` solely in terms of executable
discovery.

Related: https://github.com/astral-sh/ruff/issues/28545,
https://github.com/astral-sh/ruff-vscode/pull/1170

<!-- codex-thread: 01a0c3c7-f498-7682-9193-6e0e5307066b -->
2026-10-09 12:26:57 -04:00
Brent Westbrook 3f5a91cecf Stabilize pragma comment width handling (#28795)
Summary
--

I wasn't really planning to do a full stabilization pass, but I quickly skimmed through `preview.rs`
and remembered that the isort pragma change was kind a bug fix but technically breaking and thought
we might want to stabilize it.

This PR stabilizes the isort pragma comment width handling introduced in #27313, along with the
related pragma handling for `E501` and `W505` from #24071. There was a comment about also
stabilizing the related formatter preview feature on the function from #24071, so that is stabilized
here too.

I'm fine holding off on this, especially if the formatter change is a better fit for the 2027 style
guide. Like I said above, I mostly wanted to stabilize the isort change, but that snowballed a bit
since the helpers were shared.

Test Plan
--

Updated existing snapshots
2026-10-09 12:26:57 -04:00
Brent WestbrookandAlex Waygood 755d3aff4c Always show unsafe and display-only fixes in the CLI (#27810)
Summary
--

This is the CLI accompaniment to #27807. The main change here is showing
display-only fix diffs in
the CLI. However, display-only fixes don't have a corresponding flag
like `--unsafe-fixes`, and I
thought it would be weird to show them unconditionally when we don't do
the same for unsafe fixes,
so this PR also unconditionally renders unsafe fix diffs, even when that
flag isn't passed. We
already emit a note about the fix being unsafe, so I think it makes
sense always to show you the
fix, and make `--unsafe-fixes` enable actually applying the fix. We also
don't want to apply
display-only fixes, so enabling rendering of the fixes with
`--display-only-fixes` or similar would
also disagree with the semantics of the unsafe flag. I'm open to other
ideas here, though.

The sub-diagnostic for display-only fixes uses a higher severity than
the note for unsafe fixes and
renders in red, as shown below.

The change here also affects ty, which now has both unsafe and
display-only fixes.

I again checked what clippy and rustc do in these cases, and they don't
include any additional note or warning about the fix being unsafe:

<details><summary>Rust diagnostics</summary>
<p>

Here's a
[`clippy::needless_pass_by_value`](https://rust-lang.github.io/rust-clippy/rust-1.97.0/index.html#needless_pass_by_value)
diagnostic, which is `MaybeIncorrect` ( similar to our `Unsafe`):

```
warning: this argument is passed by value, but not consumed in the function body
 --> src/main.rs:3:15
  |
3 | fn size(data: Data) -> usize {
  |               ^^^^
  |
  = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.97.0/index.html#needless_pass_by_value
  = note: requested on the command line with `-W clippy::needless-pass-by-value`
help: consider taking a reference instead
  |
3 | fn size(data: &Data) -> usize {
  |               +
```

and here's a rustc
[`LetLike`](https://github.com/rust-lang/rust/blob/8bab26f4f68e0e26f0bb7960be334d5b520ea452/compiler/rustc_trait_selection/src/errors.rs#L268-L288)
diagnostic, which is `has-placeholders` (similar to our `DisplayOnly`
but definitely produces invalid code in this case):

```
error[E0282]: type annotations needed for `Vec<_>`
 --> placeholder.rs:2:9
  |
2 |     let values = Vec::new();
  |         ^^^^^^   ---------- type must be known at this point
  |
help: consider giving `values` an explicit type, where the type for type parameter `T` is specified
  |
2 |     let values: Vec<T> = Vec::new();
  |               ++++++++
```

</p>
</details>

Fixes https://github.com/astral-sh/ty/issues/1679

Test Plan
--

Updated existing snapshots, and some manual testing in the CLI:

<img width="965" height="400" alt="image"
src="https://github.com/user-attachments/assets/888ad79a-6853-48d4-8344-48da4af47d74"
/>

---------

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2026-10-09 12:26:57 -04:00
Micha Reiser 4776a20c73 [ruff] Support Unicode dummy variable names (#28722)
Fixes #28721
2026-10-09 12:26:57 -04: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
Brent WestbrookandMicha Reiser c97af1e712 Add a migration guide for categories (#28087)
Summary
--

As the title says, this PR extends our
[category](https://docs.astral.sh/ruff/linter/#rule-categories) docs to
include a migration guide explaining how to approach a migration to the
new categories. Initially I included a migration script and a
description of how it works, but if we're unlikely to remove linter
groups, it seems less helpful. Our recommendation is basically to
`extend-select` the new categories to round out your existing
configuration, and no dramatic migration is necessary.

I guess this is not really a "migration guide" anymore, as reflected in
the updated section title.

---------

Co-authored-by: Micha Reiser <micha@reiser.io>
2026-09-30 10:11:51 -04:00
Florian Best dbcd6b02c3 docs(faq): add Python 3.15 as supported (preview) version (#28907) 2026-09-29 09:48:15 -04:00
Brent Westbrook 6cc0678f70 Avoid running uv format in untrusted workspaces (#28873)
Summary
--

This PR adds the `--untrusted-workspace` flag to the server CLI, which
informs the server that it's running in an untrusted workspace. When
this is the case, we fall back on the internal formatting backend
instead of using `uv format` to avoid reading uv configuration and
potentially installing packages based on it.

Test Plan
--

New server tests
2026-09-28 16:47:06 -04:00
Florian Best 0fa37a3c33 docs(faq): add ty as type checker example (#28906) 2026-09-28 10:22:12 +02: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
Zsolt Dollenstein 915bb2b4bf [ty] Prefer existing @ paths over response files in Ruff and ty (#28877)
Ruff and ty interpret `@list.py` as a response-file reference even when
that literal path exists. This can turn a filename supplied by an
integration into command-line options.

Give existing literal `@` paths precedence in both CLIs, including
dangling symlinks, arguments inside nested response files, and arguments
after `--`. When the literal path is absent, keep expanding the response
file. Both CLIs share the implementation in `ruff_cli`.
2026-09-24 18:01:24 +00:00
Brent Westbrook 67b3bd4122 Update rules table with category information (#28651)
Summary
--

This PR updates our rules page with a big table inspired by [oxlint] and
[clippy]. I'm afraid this
might be a bit of a pain to review, as Codex added a ton of JS and CSS
to achieve our desired
functionality. I iterated with it a few times trying to shrink the diff
but without much luck.

Supersedes https://github.com/astral-sh/ruff/pull/28099

[clippy]: https://rust-lang.github.io/rust-clippy/master/
[oxlint]: https://oxc.rs/docs/guide/usage/linter/rules.html

Test Plan
--

Mostly local testing:


https://github.com/user-attachments/assets/fbf70dd0-1e43-467f-8d35-2767203aab3f
2026-09-21 12:51:35 -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
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
Freya Bruhin d136bd8d00 Fix line-length path in --config example (#28392)
line-length is a global option, not under `lint.`

This was introduced in #25013, after which #25389 attempted to fix it.
However, that change was made in autogenerated docs only (instead of
fixing it at the source), and thus the fix was undone again in #25396.

This instead fixes the issue in the source code, followed by a `cargo
dev generate-all`.
2026-09-08 18:29:59 -04:00
Brent Westbrook 22f65a2ab5 Bump 0.16.6 (#28280) 2026-09-03 12:36:42 -04:00
Philipp A. 0a61f8a140 Move pytest-fixture-autouse to restriction (#28219)
## Summary

The `restriction` category description refers to “language features”. I
made the wording more general so it can also apply to 3rd party APIs.

I switched one rule, `pytest-fixture-autouse` into there, as it bans a
feature that is both considered idiomatic and has no replacement, which
was pointed out by a pytest maintainer and several users:

- https://github.com/astral-sh/ruff/issues/27959#issuecomment-5485836053
- https://github.com/astral-sh/ruff/issues/12491

The rule has been disabled because it was so contentious, only to later
be placed into the `pedantic` categories with many rules that actually
improve most code bases. This puts it in the appropriate category.

## Test Plan

I ran all the tests, and grepped the docs grepped for “restriction” and
“language feature” to make sure I didn’t miss any spot where the
categories are described.
2026-09-01 08:30:47 -04:00
Brent Westbrook 9e4938c4a6 Bump 0.16.5 (#28110) 2026-08-27 12:09:07 -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 WestbrookandMicha Reiser 50a4d7fd10 Document the new category selectors (#27906)
Summary
--

This includes the user-facing updates to our linter docs and selection
settings to accompany #27666.

Test Plan
--

A few existing snapshot updates but mostly users reading this

---------

Co-authored-by: Micha Reiser <micha@reiser.io>
2026-08-27 11:26:33 -04:00
Brent Westbrook 11c76bf48f Bump 0.16.4 (#27937) 2026-08-20 13:14:29 -04:00
William WoodruffandAlex Waygood 7ed8d1fbdd Manage docs build with a dep group (#27843)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Signed-off-by: William Woodruff <william@yossarian.net>
2026-08-18 20:56:20 +00:00
William Woodruff 66418ef0d4 Use pinned forms for uvx (#27798)
Signed-off-by: William Woodruff <william@yossarian.net>
2026-08-16 16:26:55 -04:00
Brent Westbrook b0e47022cf Bump 0.16.3 (#27723) 2026-08-13 09:39:16 -04:00
renovate[bot] 1f21a772f8 Update dependency mdformat-mkdocs to v5.3.0 (#27681) 2026-08-12 07:45:48 +02:00
renovate[bot] 0d773b07bf Update dependency ruff to v0.16.2 (#27672) 2026-08-11 22:20:33 -04:00
Brent Westbrook 5b48a04097 Bump 0.16.2 (#27555) 2026-08-07 09:12:50 -04:00
renovate[bot] 8348f2f064 Update dependency ruff to v0.16.1 (#27479) 2026-08-05 08:08:26 +02:00
Brent Westbrook 80790b348b Bump 0.16.1 (#27330) 2026-07-30 13:54:42 -04:00
renovate[bot] c76580935b Update dependency mkdocs-material to v9.7.7 (#27270) 2026-07-29 08:45:05 +02:00
renovate[bot] 837f3fcab4 Update dependency ruff to v0.16.0 (#27291) 2026-07-29 08:41:52 +02:00
Martijn PietersandBrent Westbrook 5539406c16 Cover pycon Markdown formatting (#27153)
## Summary

Add a section on `pycon` handling to the *Markdown code formatting*
section.

Fixes #27151

## Test Plan

- verified markdown output locally
- run `scripts/check_docs_formatted.py --generate-docs`
- run `mkdocs build --strict`
- run `mkdocs serve` and inspect the site preview

---------

Co-authored-by: Brent Westbrook <brentrwestbrook@gmail.com>
2026-07-24 17:17:33 +00:00
Brent Westbrook a2635fd8f3 Bump 0.16.0 (#27136) 2026-07-23 14:37:34 -04:00
Brent Westbrook 2240070922 Reflect ruff: ignore and --add-ignore stabilization in documentation (#27127)
Summary
--

Follow up to #27125 and #26934 to update the docs.
2026-07-23 13:38:29 -04:00
Brent Westbrook 17ef71142c Stabilize --add-ignore (#27125)
Summary
--

This makes sense to accompany `ruff: ignore` comments being stabilized.
The preview gate has been pushed down to cover only the names vs codes
decision. I'll flag this as a comment, but I wasn't totally sure about
the LSP case. I left using `ruff: ignore` in its suppression edits
preview-gated for now.

Test Plan
--

Existing tests, dropping one that showed the preview error with
`--add-ignore`. I left `--preview` in many of the tests to continue
testing the human-readable names but removed it from one.
2026-07-23 13:38:29 -04:00
Brent Westbrook b30f040232 Stabilize new default rules (#27035)
This PR stabilizes the expanded default rule set currently in preview
and adds a new generated `Default Rules` page to the docs to avoid
needing to include a lengthy selector block in multiple places.
2026-07-23 13:38:29 -04:00
Brent Westbrook 1bb4bb0609 Stabilize Markdown formatting (#27018)
Summary
--

This PR stabilizes the Markdown formatting initially added in #22470. It
also reverts much of the
error plumbing in the LSP that was added in #24150. I considered keeping
the
`FormatResult::PreviewOnly` variant but went ahead and dropped it since
it was unused.

Closes #26866.

Test Plan
--

Updated existing snapshots, dropping `--preview` in some cases
2026-07-23 13:38:29 -04:00
Micha Reiser d96eab07b4 Insert a space after the colon in Ruff suppression comments (#27123) 2026-07-23 14:22:45 +02:00
renovate[bot] e8f6775b00 Update dependency ruff to v0.15.22 (#27064) 2026-07-22 08:07:51 +02:00
Brent Westbrook 0177a7e0d2 Bump 0.15.22 (#26884) 2026-07-16 10:54:43 -04:00
JoosboyandMahadev Annabhimoju d244fd75e9 Document argfile support (#26803)
Closes #21894 by adding a section about argfile support (using `@`) to
the configuration documentation.

---------

Co-authored-by: Mahadev Annabhimoju <219508079+Joosboy@users.noreply.github.com>
2026-07-16 10:01:32 -04:00
renovate[bot] 1659a424ce Update dependency mdformat-mkdocs to v5.2.1 (#26822) 2026-07-15 04:05:57 +00:00
renovate[bot] 80a09c8e2f Update dependency ruff to v0.15.21 (#26824) 2026-07-14 21:01:41 -07:00
Brent Westbrook 3e1f636451 Bump 0.15.21 (#26676) 2026-07-09 15:42:27 -04:00