Skip to content

Prioritize human-readable names in CLI output - #25869

Merged
ntBre merged 1 commit into
mainfrom
brent/show-fixes
Jun 11, 2026
Merged

ntBre merged 1 commit into
mainfrom
brent/show-fixes

Conversation

@ntBre

@ntBre ntBre commented Jun 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This PR swaps the rule name and code in our --show-fixes output, which previously looked like
this:

image

and now looks like this in preview:

image

The actual code change is just for this one flag, but I also examined the other CLI flags (besides
diagnostic output formats, which I'll update separately) and think that nothing else needs to be
updated. The other two main candidates were --statistics and --show-settings, but these already
show both codes and names prominently. --show-settings even prioritizes them over codes:

❯ ruff check --no-cache --ignore-noqa --statistics
1       F401    [*] unused-import
Found 1 error.
[*] 1 fixable with the `--fix` option.

❯ ruff check --no-cache --show-settings
...
linter.rules.enabled = [
        multiple-imports-on-one-line (E401),
        module-import-not-at-top-of-file (E402),
	...
]
...

Test Plan

New CLI test and the screenshots above

Summary
--

This PR swaps the rule name and code in our `--show-fixes` output, which previously looked like
this:

TODO

and now looks like this in preview:

TODO

The actual code change is just for this one flag, but I also examined the other CLI flags (besides
diagnostic output formats, which I'll update separately) and think that nothing else needs to be
updated. The other two main candidates were `--statistics` and `--show-settings`, but these already
show both codes and names prominently. `--show-settings` even prioritizes them over codes:

```console
❯ ruff check --no-cache --ignore-noqa --statistics
1       F401    [*] unused-import
Found 1 error.
[*] 1 fixable with the `--fix` option.

❯ ruff check --no-cache --show-settings
...
linter.rules.enabled = [
        multiple-imports-on-one-line (E401),
        module-import-not-at-top-of-file (E402),
	...
]
...
```

Test Plan
--

New CLI test and the screenshots above
@ntBre ntBre added cli Related to the command-line interface preview Related to preview mode features labels Jun 11, 2026
}

#[test]
fn show_fixes_preview() -> Result<()> {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Just noting that we have existing non-preview tests for this flag just above

@ntBre
ntBre marked this pull request as ready for review June 11, 2026 15:56
@ntBre
ntBre requested a review from MichaReiser June 11, 2026 15:57
@astral-sh-bot

astral-sh-bot Bot commented Jun 11, 2026

Copy link
Copy Markdown

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@ntBre
ntBre merged commit f381eb1 into main Jun 11, 2026
45 checks passed
@ntBre
ntBre deleted the brent/show-fixes branch June 11, 2026 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli Related to the command-line interface preview Related to preview mode features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants