Skip to content

Commit

Permalink
Update README.md with Clean Code link
Browse files Browse the repository at this point in the history
  • Loading branch information
david-cho-lerat-sonarsource authored and sonartech committed Oct 20, 2023
1 parent 316adf0 commit ef79dd0
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@
[![Build Status](https://travis-ci.org/SonarSource/slang.svg?branch=master)](https://travis-ci.org/SonarSource/slang)
[![Quality Gate](https://sonarcloud.io/api/project_badges/measure?project=org.sonarsource.slang%3Aslang&metric=alert_status)](https://sonarcloud.io/dashboard?id=org.sonarsource.slang%3Aslang) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=org.sonarsource.slang%3Aslang&metric=coverage)](https://sonarcloud.io/component_measures/domain/Coverage?id=org.sonarsource.slang%3Aslang)

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

* Ruby language: [analysis of Ruby documentation](https://docs.sonarqube.org/latest/analysis/languages/ruby/)
* Scala language: [analysis of Scala documentation](https://docs.sonarqube.org/latest/analysis/languages/scala/)
* Go language: [analysis of Go documentation](https://docs.sonarqube.org/latest/analysis/languages/go/)

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 Ruby and Scala
analyzers use this approach.
SLang (SonarSource Language) is a framework to quickly develop code analyzers for SonarQube to help developers write [Clean Code](https://www.sonarsource.com/solutions/clean-code/?utm_medium=referral&utm_source=github&utm_campaign=clean-code&utm_content=slang).

SLang defines language-agnostic AST. Using this AST we can develop simple syntax-based rules. Then we use a parser for real language to create this AST. Currently, Ruby and Scala analyzers use this approach.

## Ruby

We use [whitequark parser](https://github.com/whitequark/parser) to parse Ruby language by embedding it using JRuby runtime.
We use [whitequark parser](https://github.com/whitequark/parser) to parse the Ruby language by embedding it using JRuby runtime.

* AST documentation for the parser can be found [here](https://github.com/whitequark/parser/blob/master/doc/AST_FORMAT.md)
* We use simple [Ruby script](sonar-ruby-plugin/src/main/resources/whitequark_parser_init.rb) to call the parser and invoke our [visitor](sonar-ruby-plugin/src/main/java/org/sonarsource/ruby/converter/RubyVisitor.java) written in Java

## Scala

We use [Scalameta](https://scalameta.org/) to parse Scala language.
We use [Scalameta](https://scalameta.org/) to parse the Scala language.

### Scala coverage

Expand All @@ -35,11 +35,11 @@ This situation only applies to two Scala files, this current situation is accept

## Go

We use the native Go parser to parse Go language.
We use the native Go parser to parse the Go language.

## Have question or feedback?
## Have questions or feedback?

To provide feedback (request a feature, report a bug etc.) use the [SonarQube Community Forum](https://community.sonarsource.com/). Please do not forget to specify the language, plugin version and SonarQube version.
To provide feedback (request a feature, report a bug, etc.) use the [SonarQube Community Forum](https://community.sonarsource.com/). Please do not forget to specify the language, plugin version, and SonarQube version.

## Building

Expand All @@ -56,7 +56,7 @@ Build and run Unit Tests:

## Integration Tests

By default, Integration Tests (ITs) are skipped during build.
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
Expand All @@ -69,13 +69,13 @@ You can also build and run only Ruling Tests using the `ruling` property:

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

If you want to run ruling tests for specific language, you can use `ruling-{lang}` property (`ruling-scala`, `ruling-ruby`, `ruling-go`). For example:
If you want to run ruling tests for a specific language, you can use `ruling-{lang}` property (`ruling-scala`, `ruling-ruby`, `ruling-go`). For example:

./gradlew build -Pruling-scala --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. Also Scala and Go source files are not handled. For those files use a manual script like below to update the license. E.g., for Go files (on mac):
Furthermore, there are files such as `package-info.java` and `module-info.java` that spotless ignores. Also, Scala and Go source files are not handled. For those files use a manual script like below to update the license. E.g., for Go files (on Mac):

`find . -type f -name "*.go" -exec sed -i '' 's/2018-2022/2018-2023/' "{}" \;`

0 comments on commit ef79dd0

Please sign in to comment.