Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make ruff more verbose #1084

Merged
merged 1 commit into from
Dec 11, 2024
Merged

Make ruff more verbose #1084

merged 1 commit into from
Dec 11, 2024

Conversation

hmpf
Copy link
Contributor

@hmpf hmpf commented Dec 11, 2024

In ruff --output-format=full is the default.
And the statistics flag shortens the output too much to be helpful when developing

@hmpf hmpf self-assigned this Dec 11, 2024
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.18%. Comparing base (622cfad) to head (80e6a74).
Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1084   +/-   ##
=======================================
  Coverage   81.18%   81.18%           
=======================================
  Files         140      140           
  Lines        5076     5076           
=======================================
  Hits         4121     4121           
  Misses        955      955           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@elfjes
Copy link
Collaborator

elfjes commented Dec 11, 2024

question though, if the statistics flag doesn't exist anymore, why did it still shorten the output?

@hmpf
Copy link
Contributor Author

hmpf commented Dec 11, 2024

I have no idea. Removing it fixed the problem, and I couldn't find it described in the ruff docs. (If I run my locally installed ruff check -h, however...) We used a "how to convert from flake8 to ruff"-guide that might very well have been outdated.

It's not mentioned anywhere that (some?) --output-format is incompatible with --statistics. With flake8 you could use both at the same time and have both a useful view of the problem and a count.

@hmpf hmpf merged commit e41d90e into Uninett:master Dec 11, 2024
13 of 14 checks passed
@hmpf hmpf deleted the make-ruff-more-verbose branch December 11, 2024 12:03
@johannaengland
Copy link
Contributor

I don't get from this PR what it actually fixes. Was any pre-commit run failing? What was the output?

https://docs.astral.sh/ruff/configuration/#full-command-line-interface - statistics is still in use and when I locally run ruff check --statistics it outputs nothing when there are no linting problems and this for example when there are:

1	F841	[*] unused-variable
[*] fixable with `ruff check --fix`

@elfjes
Copy link
Collaborator

elfjes commented Dec 16, 2024

Yeah, so that output is not helpful for a developer. They (or at least: I) want to see which files and which lines are not passing so that they can have a look manually. With the statistics flag that's very hard to figure out

@johannaengland
Copy link
Contributor

That makes sense, then I will just amend the body of this PR to clarify this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants