Skip to content

Instantly share code, notes, and snippets.

@kaypee90
Last active June 20, 2023 09:46
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kaypee90/48f4a5b16c79ab1a0e3a256c7d3937a7 to your computer and use it in GitHub Desktop.
Save kaypee90/48f4a5b16c79ab1a0e3a256c7d3937a7 to your computer and use it in GitHub Desktop.
Scan Rust Code With Sonarqube

Scan Rust source code with Sonarqube

  • Sonarqube currently does't have rust support.
  • To scan sonarqube you will need Clippy to generate a json report file
  • You will also need Sonar-Rust, a rust plugin for sonarqube to read the results generated in clippy report file.

Resources

Steps

  1. Install clippy
  2. Add sonar-rust to sonarqube plugins
  3. Generate clippy report file on your rust project using cargo clippy --message-format=json &> sample-report.json
  4. Start sonarqube and pass the generated clippy report to it using sonar-scanner -Dsonar.rust.clippy.reportPaths=sample-report.json
  5. Login to sonarqube and view your resutls after.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment