Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I use SonarQube before making a commit?

I found Using SonarQube in Eclipse and will ask a separate question targeted at Python. But here I want to ask more generally how to use SonarQube as a replacement for lint-like UNIX CLI tools while I'm working on individual source files before I commit. Specifically, what if I don't want to fire up Eclipse? I just want to make some tweaks to source file and check it against rules such as "Collapsible 'if' statements should be merged" (the actual example that's blocking me today).

Even if I could commit to an experimental branch and see my analysis before I open a pull request, that would be better than nothing.

like image 488
tbc0 Avatar asked Nov 01 '16 22:11

tbc0


People also ask

How does SonarQube scan code?

SonarQube is an open-source platform developed by SonarSource for continuous inspection of code quality. Sonar does static code analysis, which provides a detailed report of bugs, code smells, vulnerabilities, code duplications.

Which plugin is used by developers to check the code before check in SonarQube?

SonarLint is YOUR Code Quality & Code Security tool. SonarQube is YOUR TEAM's Code Quality & Code Security tool.


1 Answers

You can use SonarLint to run the analysis before the commit. It can be installed as plugin into your editor. Download and further instructions are available here http://www.sonarlint.org

like image 95
Tibor Blenessy Avatar answered Oct 01 '22 00:10

Tibor Blenessy