Feature Request: GitLab Code Quality Reporting and --exit-zero for ruff format #19600
peterfarrell
started this conversation in
Ideas
Replies: 1 comment 4 replies
-
Thanks for the thorough write-up! We've been working on some new internal diagnostic infrastructure that will hopefully make
|
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently,
ruff check
offers an-output-format
option (e.g.,gitlab
) to generate reports for CI platforms. This is incredibly useful for integrating Ruff's linting results directly into GitLab's Code Quality reports.We propose adding a similar
--output-format=gitlab
option to theruff format
command. This would allow users to report files with formatting issues as GitLab Code Quality findings. Crucially, the report would flag the entire file as an issue, rather than specific lines, aligning with how formatting violations are typically viewed.Use Case for
--output-format
inruff format
Our existing GitLab CI/CD setup for
ruff check
looks something like this:Extending this functionality to
ruff format
would enable us to create similar Code Quality reports for formatting inconsistencies, providing a more comprehensive overview of code health within GitLab.Request for
--exit-zero
inruff format
Additionally, for improved testing of our GitLab CI/CD component for Ruff, we request the inclusion of a
--exit-zero
option forruff format
.Currently, when testing our
format
job, there's no native way to forceruff format
to exit with a0
status code, even if formatting issues are found. This complicates automated testing scenarios where we might want to check for issues without failing the CI job directly. Our current workaround involves trapping the exit code and handling it conditionally:Implementing
--exit-zero
would significantly simplify our testing workflows, allowing for cleaner and more direct validation of ourformat
jobs without complex shell logic.We believe these additions would greatly enhance Ruff's utility within CI/CD pipelines, particularly for GitLab users. We welcome any thoughts or feedback on these proposals.
Beta Was this translation helpful? Give feedback.
All reactions