We have started using Gitlab and SonarQube for development in Java.
We have also using pre-commit hook for running sonar-scanner
and according to its result we are appending SUCCESS/FAILURE/ERROR string to commit message by commit-msg hook. And accordingly on server side we are using update hook, for deciding whether to accept Push or not w.r.t. commit message.
The loophole in this is if developer deleted client side hooks and append SUCCESS manually. So server cannot assure on client-side hooks.
My question is, is there anyway to guaranty that the sonar-scanner
is really triggered or not? OR Any other solution to run sonar-scanner
by server-side hook?