How to run a local Sonar check before merging to a GIT repository?

1.6k views Asked by At

In my current project, whenever a GIT merge of a feature branch is performed to master, a remote Sonar analysis is performed with SonarQube.

I heard from my colleagues that they tried the Sonar plugin for Intellij and it passed their code, however the remote Sonar configuration failed the branch build. This meant creating new GIT branches with Sonar fixes.

Is there any way to configure and run a server-like Sonar check on the local machine before pushing and merging, so that issues are addressed quickly and no new branches are needed?

1

There are 1 answers

0
Florian Salihovic On

You can check out git (web) hooks, depending on your overall set up.