I have read several posts on stackoverflow that stated, that the usage of sonar as a pre-commit analysis tool is inefficient, due to the fact that it has to run compilation of the whole project, run its analysis etc.
However, the manual for sonarqube state that there is a sonar.inclusions property for setting the list of files to run analysis on. So I was thinking about running analysis on files that have been changed/modified as a pre-commit hook and failing the commit in case too many issues were added.
As I understood, it is possible to fetch the list of modified and added files through svnlook; there is also the ability to point sonar analyzer to a concrete .properties file (say, the file pointing to a configuration that has only coding rules and cyclomatic complexity and LCOM4 metrics).
However, I fail to understand how to obtain the result of Sonar analysis within the pre-commit hook script and provide, say, a link to the analysis result. Is it at all possible? Are there any real-world, or at least remotely relevant examples of such practices?
Thanks in advance.