Check new offence from API/CLI/programmatically

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    Sonarqube:latest
  • what are you trying to achieve
    I am looking for a way to check for the existence of new offenses in a programmatic /automated way.

Ultimately, fails git push (pre-push hook) if new offence is introduced.

  • what have you tried so far to achieve this
    Checking documentation for possible apis

Hi,

There’s no good way to do this pre-commit. Instead, you can analyze PRs or feature branches and block merging if the new code doesn’t meet the team’s standards. Note that branch and PR analysis are available starting in Developer Edition($). The docs should get you started.

 
HTH,
Ann

1 Like