简体   繁体   中英

Is it possible to stop svn commit if the code has sonar violations?

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)

Using a pre-commit hook, you can run a SonarQube analysis in preview mode (ie 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM