0
votes

I need to find a way to do a pre-commit incremental analysis with rules supplied by SonarQube 5.4 hosted on a server. The most important files to analyze are JavaScript files, and we are working in C# using ASP.NET framework, so installing Eclipse for a large team is not feasible.

I have tried Sonar-Scanner 2.8, but it does not pick up the analysis already done on the server (shows all issues as new), and it also does not react to exclusions. Documentation on that matter is outdated, as, for example, incremental analysis is not supported anymore, and issues analysis is not documented properly regarding what it does,

Some relevant parts from sonar-project.properties:

sonar.exclusions=**/Scripts/*angular*.js,**/Scripts/*bootstrap*.js,**/Scripts/*d3*.js,**/Scripts/*jquery*.js,**/Scripts/*modernizr*.js,**/Scripts/*respond*.js,**/Scripts/*toolkit*.js,**/tbshared/**/*.*,**/Scripts/*reference*.js,**/packages/**/*.*,**/Scripts/angular*.map,**/Scripts/*.json,**/Scripts/*.css,**/Scripts/i18n/*.* 
...    
#Enable HTML
    sonar.issuesReport.html.enable=true

    #Enable console output
    sonar.issuesReport.console.enable

    #Enable incremental analysis
    sonar.analysis.mode=issues
1
It will be nice to provide a link on documents, when you state that they are outdated. Regarding the question - maybe you should have a look at sonarlint.org/commandline/index.html and docs.sonarqube.org/display/SONAR/Local+and+Branch+Analysis and docs.sonarqube.org/display/PLUG/GitHub+Plugin ? - Godin
I converted comment into answer, so that maybe you can mark it as accepted ;) - Godin
I am still researching on that matter, other than a json example on the front page of SonarLint, is there a a full list of parameters that json config file accepts and maybe some examples of that configuration? Thank you! - worldpart
What kind of more parameters you are searching and why? According to my understanding: as soon as project will be connected with server in SonarLint for command-line - it will be aware of issues recorded on server as well as exclusions. - Godin
For example, now I am having problems with "Invalid characters". I need to configure the encoding, but there are no sonarlint examples to do so, which just leaves me guessing... - worldpart

1 Answers

1
votes

Maybe one day SonarLint for Visual Studio will be extended to cover more languages than just C#.

But as of today you can take a look at:

All those links are available in SonarQube documentation on page "Local and Branch Analysis".