For a developer precommit run, will sonar lint report a major issue on the html report for a (new code) coverage failure?

944 views
Skip to first unread message

julian...@gmail.com

unread,
Dec 19, 2016, 10:52:43 PM12/19/16
to SonarLint
Hi Everyone, 

We're running Sonarqube 5.5 and sonar-scanner 2.5 (evaluating a switch to sonar lint). 

For static analysis issues - we can generate a nice html report showing coverage as major issues - as a developer pre-commit run?

(Just so we know if a new-code coverage failure that will go red  on sonarqube will show up on the precommit)
 
Cheers
Julian

janos....@sonarsource.com

unread,
Dec 20, 2016, 2:44:33 AM12/20/16
to SonarLint, julian...@gmail.com
Hi Julian,

If I understand correctly, you want to perform an analysis without publishing to the project on SonarQube, and thereby avoid raising red flags. The first two options documented on this page can be useful for you:
  • You want to check for new issues before committing your code - SonarLint is the answer for this. It raises issues in your IDE as you type.  
  • You want to check for new issues before a Pull Request is merged - Pull request (PR) analysis allows you to configure your CI engine to perform "preview" analysis (i.e. analysis without updating SonarQube) on PR's. Any new issues are annotated in the PR itself. If none are found, an "all clear" message is added instead. PR analysis is available for GitHub projects with the GitHub plugin, and on some other providers with Other Plugins.
You could use the SonarLint CLI to perform pre-commit checks.

Cheers,
Janos

Julien HENRY

unread,
Jan 2, 2017, 8:07:37 AM1/2/17
to Janos Gyerik, SonarLint, julian...@gmail.com
Hi guys,

I think Julian was talking about pre-commit check of coverage on new code. This use case is currently not supported. SonarLint and GitHub pull request analysis features are both only focused on issues. CPD and coverage topics are not supported, so the only way today is to do a full analysis, and fix afterward if needed.

++

Julien

--
You received this message because you are subscribed to the Google Groups "SonarLint" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarlint+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarlint/cab1fc98-72c7-457e-9e1f-2e75437ba749%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages