Visitar URL original
Revert "Display output severity in preview" by ntBre · Pull Request #26050 · astral-sh/ruff · GitHub
Skip to content

Revert "Display output severity in preview" - #26050

Merged
ntBre merged 7 commits into
mainfrom
brent/revert-severity
Jun 17, 2026
Merged

ntBre merged 7 commits into
mainfrom
brent/revert-severity

Conversation

@ntBre

@ntBre ntBre commented Jun 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This reverts #23845 since we're now prioritizing the human-readable names and category work before getting back to severity.

I had to revert (the revert of) the changes to the ecosystem check script and then add another normalization pass again to get CI to pass. I can follow up immediately to revert these changes once this is the baseline.

Test Plan

Existing tests updated following #25937

I said I didn't love diagnostics like this:

fib.py:1:8: unused-import: [*] `os` imported but unused

with both a human-readable name and a fix indicator on that PR, but I think it's not actually that
bad, and I haven't thought of a better alternative, so I think it's fine for now.

@ntBre ntBre added preview Related to preview-mode features diagnostics Diagnostic messages, annotations, fixes & rendering infra--not for PRs that just add new diagnostics labels Jun 16, 2026
@astral-sh-bot

astral-sh-bot Bot commented Jun 16, 2026 •

Copy link
Copy Markdown

Memory usage report

Memory usage unchanged ✅

@astral-sh-bot

astral-sh-bot Bot commented Jun 16, 2026 •

Copy link
Copy Markdown

ecosystem-analyzer results

No diagnostic changes detected ✅

Full report with detailed diff (timing results)

ntBre added 6 commits June 16, 2026 15:03
Summary
--

This reverts #23845 since we're now prioritizing the human-readable names and category work before
getting back to severity.

Test Plan
--

Existing tests updated following #25937

I said I didn't love diagnostics like this:

```
fib.py:1:8: unused-import: [*] `os` imported but unused
```

with both a human-readable name and a fix indicator on that PR, but I think it's not actually that
bad, and I haven't thought of a better alternative, so I think it's fine for now.
this was an additive change in stable before, but reverting would be breaking, so we'll just leave
`Severity::Error` in both cases.
@ntBre
ntBre force-pushed the brent/revert-severity branch from d0b17d6 to 45b82d4 Compare June 16, 2026 19:50
@astral-sh-bot

astral-sh-bot Bot commented Jun 16, 2026

Copy link
Copy Markdown

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Formatter (stable)

✅ ecosystem check detected no format changes.

Formatter (preview)

✅ ecosystem check detected no format changes.

@ntBre
ntBre marked this pull request as ready for review June 16, 2026 20:20
@ntBre
ntBre requested a review from a team as a code owner June 16, 2026 20:20
@astral-sh-bot
astral-sh-bot Bot requested a review from MichaReiser June 16, 2026 20:20

@MichaReiser MichaReiser left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I'm leaning towards only changing the output rendering, but keep using diagnostic.severity in the machine-readable output formats.


#[derive(Debug, Clone, Copy, PartialOrd, Ord, PartialEq, Eq, Hash, Serialize)]
#[serde(rename_all = "camelCase")]
enum SarifLevel {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I would keep that, I think


Ok(Self {
rule_id: RuleCode::from_diagnostic(diagnostic, config),
level: SarifLevel::from(diagnostic.severity()),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also keep this line.

code: diagnostic.secondary_code().map(|code| code.as_str()),
name: diagnostic.id().as_str(),
severity: diagnostic.severity(),
severity: Severity::Error,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would keep this unchanged.

@ntBre
ntBre enabled auto-merge (squash) June 17, 2026 13:33
@ntBre
ntBre merged commit 02b49d9 into main Jun 17, 2026
58 checks passed
@ntBre
ntBre deleted the brent/revert-severity branch June 17, 2026 13:35
ntBre added a commit that referenced this pull request Jun 18, 2026
## Summary

Follow up to #26050 to clean up the ecosystem check script now that
diagnostics without severity are the baseline again. This reverts both
the temporary normalization code from that PR and the earlier regex
change from #23845.

## Test Plan

CI on this PR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

diagnostics Diagnostic messages, annotations, fixes & rendering infra--not for PRs that just add new diagnostics preview Related to preview-mode features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants