Support ruff linter report files

Ruff seems to be a pretty popular python linter: charliermarsh/ruff: An extremely fast Python linter, written in Rust. (github.com)
In the SonarCloud project settings it currently only lists options for report from Bandit, Flake8 and Pylint.

Ruff does support the output in machine readable formats.
From their documentation:

The style in which violation messages should be formatted: "text" (default), "grouped" (group messages by file), "json" (machine-readable), "junit" (machine-readable XML), "github" (GitHub Actions annotations) or "gitlab" (GitLab CI code quality report).
charliermarsh/ruff: format option

My best guess is that the junit XML format is what you most likely can/could support.
Would you be able to add support?

1 Like

Since I posted early at the start of the year, this feature request probably got missed. Pinging here to bring it back up.

1 Like

Hi Sebastian, good to see you on the forum again!

We’re taking a look at Ruff, thanks for bringing it to our attention.

2 Likes

Hi Team,

Has there been any movement on this since?
Ruff has gained a lot more popularity since Jan23 is now by far the most popular linter in the python eco-system.
Looking through your Jira, it seems like there’s no ticket referencing ruff.
https://sonarsource.atlassian.net/issues/?jql=text%20~%20ruff
When can we expect support for ruff?

Hi Julian,

We’re definitely working on it for the near future. While I don’t have an exact date on when you can expect it, you can subscribe for updates here.

1 Like

Pythonistas, thanks for your feedback. Along with some new rules, this is now the reality for SonarCloud and will be in SonarQube 10.2. You can generate a Ruff report into JSON format with a command like
ruff -o my_report.json --format json <path/to/files/to/analyze>.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.