astral-sh / ruff

An extremely fast Python linter and code formatter, written in Rust.
https://docs.astral.sh/ruff
MIT License
31.82k stars 1.07k forks source link

[Feature Idea] Add column headers to `ruff check --statistics`, to avoid ambiguity #13717

Open NFeruchBCG opened 3 days ago

NFeruchBCG commented 3 days ago

This is a question that can be easily answered, but ideally wouldn't have to be asked if there were column headers.

Here is an example output to running ruff check --statistics

$ ruff check --statistics
317     F541    [*] f-string-missing-placeholders
241     F401    [ ] unused-import
112     F841    [*] unused-variable
 72     F811    [ ] redefined-while-unused
 65     F821    [ ] undefined-name
 36     E401    [*] multiple-imports-on-one-line
 23     E712    [*] true-false-comparison
 19     E711    [*] none-comparison
 19     E722    [ ] bare-except
 18     E721    [ ] type-comparison
 10     F405    [ ] undefined-local-with-import-star-usage
  6     E701    [ ] multiple-statements-on-one-line-colon
  4     E402    [ ] module-import-not-at-top-of-file
  4     F403    [ ] undefined-local-with-import-star
  3     E713    [*] not-in-test
  3     F522    [*] string-dot-format-extra-named-arguments
  2     E731    [*] lambda-assignment
  2     F601    [ ] multi-value-repeated-key-literal
  2     F632    [*] is-literal
  2     F901    [*] raise-not-implemented
  1     E741    [ ] ambiguous-variable-name

For anyone new to using ruff, it's not immediately apparent what each column means.

Sure, it's reasonable to assume that the first column is the # of occurrences and that the second column is the rule, but what [*] means is unclear. I think having an explicit header row to denote what each column is would make for a better experience :D

dhruvmanila commented 6 hours ago

Just to be clear, [*] means that the violation is fixable.