No description or website provided.
Clone or download
Latest commit c44829d Jan 15, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
gradle/wrapper Create slang-enterprise gradle build Nov 29, 2018
its Create slang-enterprise gradle build Nov 29, 2018
slang-antlr Create slang-enterprise gradle build Nov 29, 2018
slang-api Create slang-enterprise gradle build Nov 29, 2018
slang-checks Create slang-enterprise gradle build Nov 29, 2018
slang-plugin SONARSLANG-349 Fix SSF-63 (#11) Dec 10, 2018
slang-testing Create slang-enterprise gradle build Nov 29, 2018
sonar-kotlin-plugin SONARSLANG-349 Fix SSF-63 (#11) Dec 10, 2018
sonar-ruby-plugin SONARSLANG-346 [Ruby] Fix NoClassDefFoundError RubyBigDecimal (#10) Dec 10, 2018
sonar-scala-plugin SONARSLANG-349 Fix SSF-63 (#11) Dec 10, 2018
utils Create slang-enterprise gradle build Nov 29, 2018
.gitattributes Update git attributes and gradle wrapper Dec 13, 2018
.gitignore Update git attributes and gradle wrapper Dec 13, 2018
.gitmodules Create slang-enterprise gradle build Nov 29, 2018
.travis.yml Do not build public_master branch (used for sync with public slang)[S… Dec 13, 2018
LICENSE_HEADER Create slang-enterprise gradle build Nov 29, 2018
README.md Fix SonarQube badges broken links Jan 15, 2019
build.gradle Maven Central rules compliant Dec 13, 2018
gradle.properties Prepare for next development iteration 1.4.1-SNAPSHOT (#16) Dec 10, 2018
gradlew Create slang-enterprise gradle build Nov 29, 2018
gradlew.bat Update git attributes and gradle wrapper Dec 13, 2018
settings.gradle Move artifactsToDownload and some of the remove build warnings (#9) Dec 10, 2018
travis.sh Add missing env var for travis Nov 30, 2018

README.md

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

Build and run Unit Tests:

./gradlew build

Integration Tests

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 its/sources

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

./gradlew build -Pits --info --no-daemon -Dsonar.runtimeVersion=7.4

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:

./gradlew licenseFormat