226 Commits

Author SHA1 Message Date
Dylan 66f93cf7ed Bump 0.15.12 (#24815) 2026-04-24 12:36:40 -05:00
Amethyst Reese 49aa2b253d Implement #ruff:ignore logical-line suppressions (#23404)
Adds support for `#ruff:ignore[code]` style suppressions as either
own-line
or end-of-line comments. The range covered by these suppressions is
determined
by the comment's position relative to the associated logical line
(statement
or suite header).

Standalone `ignore` comments apply to an entire multi-line
statement/header if the comment appears above the first line:
```py
# covers the entire header
def foo(
	arg1,
	arg2,
):
	pass
```
But will only apply to a single following line if it appears in the
middle of a multi-line statement/header:
```py
def foo(
	# only covers the next line
	arg1,
	arg2,
):
	pass
```

Trailing comments will only apply to a single physical line, similar to
existing `#noqa` comments:

```py
def foo(
    arg1, # only covers arg1
    arg2,
):
    pass
```


Intervening comments are allowed, which enables "stacking" of
`#ruff:ignore` comments with other own-line pragma comments:
```py
# ruff:ignore[code]
# fmt:off
value = [
	1, 2,
	3, 4,
]
# fmt:on
```

Includes some refactoring of the structs to generalize the naming/terms
used, otherwise the rest of the suppression system should be able to
stay unchanged.
2026-04-20 11:38:32 -07:00
Amethyst Reese 53554b1cfe Bump 0.15.11 (#24678) 2026-04-16 11:17:46 -07:00
Brent Westbrook 252f76102a Bump 0.15.10 (#24519) 2026-04-09 09:48:41 -04:00
Dylan 724ccc1ae8 Bump 0.15.9 (#24369) 2026-04-02 12:59:00 -05:00
Micha Reiser 2d6ce56125 Fix all cargo shear warnings (#24268) 2026-03-29 13:57:30 +01:00
Amethyst Reese c2a8815842 Release 0.15.8 (#24217)
- **changelog**
- **everything else**
2026-03-26 11:20:09 -07:00
Brent Westbrook 0ef39de46c Bump 0.15.7 (#24049) 2026-03-19 12:09:44 -04:00
Dylan e4c7f35777 Bump 0.15.6 (#23919) 2026-03-12 17:48:57 -05:00
Amethyst Reese 5e4a3d9c3b Bump 0.15.5 (#23743)
Co-authored-by: Brent Westbrook <36778786+ntBre@users.noreply.github.com>
2026-03-05 19:48:21 +00:00
Brent Westbrook f14edd8661 Bump 0.15.4 (#23595)
Just to be sure, I ran the example from #23587 again on this branch:

```console
~/astral/ruff on  brent/0.15.4 [$] is 📦 v0.15.4 via 🐍 v3.14.2 via 🦀 v1.93.0
❯ echo 'x = id' | uvx ruff@latest --isolated check - --preview --select ANN003,PLR1712

error: Ruff crashed. If you could open an issue at:

    https://github.com/astral-sh/ruff/issues/new?title=%5BPanic%5D

...quoting the executed command, along with the relevant file contents and `pyproject.toml` settings, we'd be very appreciative!


thread 'main' (1681253) panicked at crates/ruff_python_semantic/src/definition.rs:285:26:
index out of bounds: the len is 0 but the index is 0
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

~/astral/ruff on  brent/0.15.4 [$] is 📦 v0.15.4 via 🐍 v3.14.2 via 🦀 v1.93.0
❯ echo 'x = id' | just run --isolated check - --preview --select ANN003,PLR1712
cargo run -p ruff -- --isolated check - --preview --select ANN003,PLR1712
   Compiling ruff_python_semantic v0.0.0 (/home/brent/astral/ruff/crates/ruff_python_semantic)
   Compiling ruff v0.15.4 (/home/brent/astral/ruff/crates/ruff)
   Compiling ruff_linter v0.15.4 (/home/brent/astral/ruff/crates/ruff_linter)
   Compiling ruff_graph v0.1.0 (/home/brent/astral/ruff/crates/ruff_graph)
   Compiling ruff_workspace v0.0.0 (/home/brent/astral/ruff/crates/ruff_workspace)
   Compiling ruff_markdown v0.0.0 (/home/brent/astral/ruff/crates/ruff_markdown)
   Compiling ruff_server v0.2.2 (/home/brent/astral/ruff/crates/ruff_server)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 23.14s
     Running `target/debug/ruff --isolated check - --preview --select ANN003,PLR1712`
warning: Detected debug build without --no-cache.
All checks passed!
```
2026-02-26 14:46:41 -05:00
Brent Westbrook e5f2f36a3f Bump 0.15.3 (#23585) 2026-02-26 10:22:43 -05:00
Dylan 7cc15f024b Bump 0.15.2 (#23430) 2026-02-19 15:04:36 -06:00
Amethyst Reese a2f11d239f Prepare for 0.15.1 (#23253)
- **Changelog**
- **Everything else**

---------

Co-authored-by: Brent Westbrook <36778786+ntBre@users.noreply.github.com>
2026-02-12 14:17:21 -08:00
Brent Westbrook ce5f7b6127 Bump 0.15.0 (#23055) 2026-02-03 12:20:59 -05:00
Brent Westbrook 67ec234d04 Stabilize range suppressions (#22983)
Added in https://github.com/astral-sh/ruff/pull/21623. 

I think I caught everything, including the preview reference in the
linter docs, but hopefully @amyreese will remember anything else I
missed.
2026-02-03 10:01:37 -05:00
Amethyst Reese ffa07b57f8 Apply formatting to markdown code blocks (#22470)
Adds initial support for formatting Python code blocks inside Markdown
files.

- Adds `Markdown` source types/kinds
- Maps `.md` file extension to `Markdown` by default
- Uses simple regex adapted from blacken-docs to find and format fenced
python code blocks
- Dedents contents before formatting, and reapplies indent from fenced
<code>```py</code> header
- Selects `Python` vs `Stub` options based on language label on code
block
- Silently skips formatting for any code block with syntax errors or
that produce formatting errors.
- CLI tests formatting via both stdin and from filesystem
- Requires running with `--preview`, and otherwise emits formatting
error when given a markdown file
- Requires a user to `extend-include = ["**/*.md"]` if they want to
format markdown files by default

Limitations:

- Returns a formatting error if run with a range of any sort
- Ignores implicit code blocks (no code fence)
- Doesn't yet support `~~~` fences, arbitrary fence lengths, or code
blocks inside blockquotes

Issue #3792
2026-01-27 17:26:09 -08:00
Amethyst Reese 8b2e7b36f2 Prepare release v0.14.14 (#22813) 2026-01-22 12:48:46 -08:00
Amethyst Reese c696ef4025 Skip walking all tokens when loading range suppressions (#22446)
- Adds `Tokens::split_at()` to get tokens before/after an offset.
- Updates `Suppressions::load_from_tokens` to take an `Indexer` and use
comment ranges to minimize the need for walking tokens looking for
indent/dedent.

Adapted from
https://github.com/astral-sh/ruff/pull/21441#pullrequestreview-3503773083

Fixes #22087
2026-01-15 12:35:24 -08:00
Brent Westbrook fd9f87d02d Bump 0.14.13 (#22604) 2026-01-15 12:53:20 -05:00
Brent Westbrook f9dd973b13 Bump 0.14.12 (#22602) 2026-01-15 10:41:03 -05:00
Jason K Hall 056d935fcd wasm: Require explicit logging initialization (#22587)
Co-authored-by: Micha Reiser <micha@reiser.io>
2026-01-15 08:44:54 +00:00
Dylan c920cf8cdb Bump 0.14.11 (#22462) 2026-01-08 12:51:47 -06:00
Matthew Mckee a2e0ff57c3 Run cargo sort (#22310) 2026-01-02 19:58:15 +00:00
Brent Westbrook 5e7fc9a4e1 Render the entire diagnostic message in all output formats (#22164)
Summary
--

This PR fixes https://github.com/astral-sh/ty/issues/2186 by replacing
uses of
`Diagnostic::body` with [`Diagnostic::concise_message`][d]. The initial
report
was only about ty's GitHub and GitLab output formats, but I think it
makes sense
to prefer `concise_message` in the other output formats too. Ruff
currently only
sets the primary message on its diagnostics, which is why this has no
effect on
Ruff, and ty currently only supports the GitHub and GitLab formats that
used
`body`, but removing `body` should help to avoid this problem as Ruff
starts to
use more diagnostic features or ty gets new output formats.

Test Plan
--

Updated existing GitLab and GitHub CLI tests to have `reveal_type`
diagnostics

[d]:
https://github.com/astral-sh/ruff/blob/395bf106ab/crates/ruff_db/src/diagnostic/mod.rs#L185
[t]:
https://github.com/astral-sh/ruff/blob/395bf106ab/crates/ruff/tests/cli/lint.rs#L3509
2025-12-24 10:28:24 -05:00
Dylan 45bbb4cbff Bump 0.14.10 (#22058) 2025-12-18 13:08:17 -06:00
Amethyst Reese 3f63ea4b50 Prepare 0.14.9 release (#21927)
- **Changelog and docs**
- **metadata**
2025-12-11 13:17:52 -08:00
Amethyst Reese 4e67a219bb apply range suppressions to filter diagnostics (#21623)
Builds on range suppressions from
https://github.com/astral-sh/ruff/pull/21441

Filters diagnostics based on parsed valid range suppressions.

Issue: #3711
2025-12-08 16:11:59 -08:00
Brent Westbrook 9d4f1c6ae2 Bump 0.14.8 (#21791) 2025-12-04 09:45:53 -05:00
Dylan ecab623fb2 Bump 0.14.7 (#21684) 2025-11-28 14:34:27 -06:00
Brent Westbrook 59c6cb521d Bump 0.14.6 (#21558) 2025-11-21 09:00:56 -05:00
Brent Westbrook 87dafb8787 Bump 0.14.5 (#21435) 2025-11-13 14:37:31 -05:00
Dylan c7ff9826d6 Bump 0.14.4 (#21306) 2025-11-06 15:47:29 -06:00
Amethyst Reese 8737a2d5f5 Bump v0.14.3 (#21152)
- **Upgrade to rooster==0.1.1**
- **Changelog for v0.14.3**
- **Bump v0.14.3**
2025-10-30 17:06:29 -07:00
Brent Westbrook 83a3bc4ee9 Bump 0.14.2 (#21051) 2025-10-23 15:17:22 -04:00
Dylan 2bffef5966 Bump 0.14.1 (#20925) 2025-10-16 12:44:13 -05:00
Amethyst Reese beea8cdfec Bump 0.14.0 (#20751) 2025-10-07 11:05:47 -07:00
Dylan 188c0dce29 Bump 0.13.3 (#20685) 2025-10-02 14:14:05 -05:00
Brent Westbrook b0bdf0334e Bump 0.13.2 (#20576) 2025-09-25 10:37:46 -04:00
Dan Parizher 3e1e02e9b6 Fix non‑BMP code point handling in quick‑fixes and markers (#20526)
Co-authored-by: Micha Reiser <micha@reiser.io>
2025-09-24 10:08:00 +02:00
ShikChen dbc5983503 Update import path to ruff-wasm-web (#20539) 2025-09-23 16:57:26 +00:00
Dylan 7b40428b6a Bump 0.13.1 (#20473) 2025-09-18 19:25:17 +00:00
Takayuki Maeda 98071b49c2 [playground] Enable inline noqa for multiline strings in playground (#20442) 2025-09-17 09:29:40 +02:00
Amethyst Reese a3ec8ca9df Remove Diagnostic::expect_range and all consumers (#20322)
Replace usage with `range().unwrap_or_default()` or more appropriate
alternatives based on context.
2025-09-10 17:19:20 -07:00
Brent Westbrook a1fdd66f10 Bump 0.13.0 (#20336) 2025-09-10 12:11:22 -04:00
Dylan c6516e9b60 Bump 0.12.12 (#20242) 2025-09-04 11:35:56 -05:00
Brent Westbrook c2bc15bc15 Bump 0.12.11 (#20136) 2025-08-28 09:45:01 -04:00
Dylan c68ff8d90b Bump 0.12.10 (#20025) 2025-08-21 13:09:31 -05:00
Brent Westbrook ef422460de Bump 0.12.9 (#19917) 2025-08-14 11:54:44 -04:00
Dylan f51a228f04 Bump 0.12.8 (#19813) 2025-08-07 13:52:16 -05:00