org.sonarsource.slang:sonar-ruby-plugin

Code Analyzer for Ruby


License
APSL-1.0

Documentation

sonar-ruby

Build Status Quality Gate Status Coverage

This is a developer documentation. If you want to analyze source code in SonarQube read the analysis of Ruby documentation.

We use whitequark parser to parse the Ruby language by embedding it using JRuby runtime.

  • AST documentation for the parser can be found here
  • We use simple Ruby script to call the parser and invoke our visitor written in Java

Have questions or feedback?

To provide feedback (request a feature, report a bug, etc.) use the SonarQube Community Forum. Please do not forget to specify the language, plugin version, and SonarQube version.

Building

Build

Build and run Unit Tests:

./gradlew build

Integration Tests

By default, Integration Tests (ITs) are skipped during builds. If you want to run them, you need first to retrieve the related projects which are used as input:

git submodule update --init its/sources

Then build and run the Integration Tests using the its property:

./gradlew build -Pits --info --no-daemon

You can also build and run only Ruling Tests using the ruling property:

./gradlew build -Pruling --info --no-daemon

License headers

License headers are automatically updated by the spotless plugin but only for Java files. Furthermore, there are files such as package-info.java and module-info.java that spotless ignores.