Skip to content

Latest commit

 

History

History
51 lines (30 loc) · 2.62 KB

README.md

File metadata and controls

51 lines (30 loc) · 2.62 KB

SLang

Build Status Quality Gate Coverage

This is a developer documentation. If you want to analyze source code in SonarQube read one of the following documentations:

SLang (SonarSource Language) is a framework to quickly develop code analyzers for SonarQube. SLang defines language agnostic AST. Using this AST we can develop simple syntax based rules. Then we use parser for real language to create this AST. Currently Kotlin, Ruby and Scala analyzers use this approach.

Kotlin

We use embeddable library of Kotlin compiler to create AST and visitor to create SLang AST.

Ruby

We use whitequark parser to parse 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

Scala

We use Scalameta to parse Scala language.

Building

Run:

mvn clean install

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

git submodule update --init

Then run the ITs

cd its
mvn clean install -Dsonar.runtimeVersion=7.1

License headers

When adding a new source file, you will need to add license headers. Instead of copy-pasting blocks, the following command line can be used:

mvn license:format