I want to add a pre-hook to SVN, basically it should stop if any new violations were introduced in the checked in java file. (we are using SonarQube for code quality)
Asked
Active
Viewed 1,287 times
0
-
How long do these SonarQube checks take? Keep in mind that anything done in the pre-commit hook is going to stop both the in-progress commit **and** any other commits from being processed until it completes; if your checks take 5 minutes, can you really afford to block people from committing for 5 minutes at a time? – alroc May 29 '15 at 02:46
1 Answers
2
Using a pre-commit hook, you can run a SonarQube analysis in preview mode (i.e. an analysis that does not push data to the server) and check if issues (and most importantly new issues) were found or not. If (new) issues are found, then you can prevent the commit.
Please read the Getting Issues Report in Preview Mode documentation.

Fabrice - SonarSource Team
- 26,535
- 3
- 62
- 58