Repository navigation
Commit f381eb1
authored
Prioritize human-readable names in CLI output (#25869)
Summary
--
This PR swaps the rule name and code in our `--show-fixes` output, which
previously looked like
this:
<img width="324" height="107" alt="image"
src="https://github.com/user-attachments/assets/32dff652-421c-4e7a-adbd-ac87cc740965"
/>
and now looks like this in preview:
<img width="314" height="103" alt="image"
src="https://github.com/user-attachments/assets/d7d942d6-d5a5-4622-b9a2-a271eb5b0663"
/>
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 above1 parent b9b4546 commit f381eb1
3 files changed
Lines changed: 49 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
226 | | - | |
| 226 | + | |
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
| |||
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
255 | | - | |
| 255 | + | |
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
| |||
447 | 447 | | |
448 | 448 | | |
449 | 449 | | |
450 | | - | |
| 450 | + | |
451 | 451 | | |
452 | 452 | | |
453 | 453 | | |
| |||
477 | 477 | | |
478 | 478 | | |
479 | 479 | | |
480 | | - | |
481 | | - | |
482 | | - | |
483 | | - | |
484 | | - | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
485 | 493 | | |
486 | 494 | | |
487 | 495 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3703 | 3703 | | |
3704 | 3704 | | |
3705 | 3705 | | |
| 3706 | + | |
| 3707 | + | |
| 3708 | + | |
| 3709 | + | |
| 3710 | + | |
| 3711 | + | |
| 3712 | + | |
| 3713 | + | |
| 3714 | + | |
| 3715 | + | |
| 3716 | + | |
| 3717 | + | |
| 3718 | + | |
| 3719 | + | |
| 3720 | + | |
| 3721 | + | |
| 3722 | + | |
| 3723 | + | |
| 3724 | + | |
| 3725 | + | |
| 3726 | + | |
| 3727 | + | |
| 3728 | + | |
| 3729 | + | |
| 3730 | + | |
| 3731 | + | |
| 3732 | + | |
| 3733 | + | |
| 3734 | + | |
| 3735 | + | |
| 3736 | + | |
3706 | 3737 | | |
3707 | 3738 | | |
3708 | 3739 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
369 | 369 | | |
370 | 370 | | |
371 | 371 | | |
372 | | - | |
| 372 | + | |
373 | 373 | | |
374 | 374 | | |
0 commit comments