I want to implement a scenario when a developer commits code, sonar code quality checks should get e

I want to implement a scenario when a developer commits code, sonar code quality checks should get executed and a report should be generated. Only after the quality gate has been passed should developers be permitted to commit code to the Github repository.

SonarQube does not perform pre-commit checks. My recommendation will be to enforce quality at pull request level. You may also consider using Quality Gate with your preferred New Code definition.

Alternatively, SonarLint will offer early feedback to the developer.

1 Like

Hi - I just want to add the way it is mentioned in the below link. how i will get the settings shown in the 2nd (point no 4)screenshot mentioned in the article where it populates SonarQube Code Analysis?

  1. Require status check to pass before merging
  2. Tick the SonarQube Code Analysis check.