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 checkoffers an-output-formatoption (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=gitlaboption to theruff formatcommand. 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-formatinruff formatOur existing GitLab CI/CD setup for
ruff checklooks something like this:Extending this functionality to
ruff formatwould enable us to create similar Code Quality reports for formatting inconsistencies, providing a more comprehensive overview of code health within GitLab.Request for
--exit-zeroinruff formatAdditionally, for improved testing of our GitLab CI/CD component for Ruff, we request the inclusion of a
--exit-zerooption forruff format.Currently, when testing our
formatjob, there's no native way to forceruff formatto exit with a0status 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-zerowould significantly simplify our testing workflows, allowing for cleaner and more direct validation of ourformatjobs 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