Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python - Difference between Sonarcube Vs pylint

I'm evaluating test framework, lint and code coverage options for a new Python project I'll be working on.

I've chosen pytest for the testing needs. After reading a bunch of resources, I'm confused when to use Sonarcube, Sonarlint , pylint and coverage.py.

Is SonarLint and Pylint comparable? When would I use Sonarcube?

I need to be able to use this in a Jenkins build. Thanks for helping!

like image 894
Aqua267 Avatar asked May 08 '19 17:05

Aqua267


People also ask

What is SonarQube used for?

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.

How do you use sonar lint?

Open the "Sonar Lint Report" view and run the analysis on the "Current project". Afterwards, revert all your SVN changes. Do not run the analysis again as the Sonar Lint Plugin only analyzes changed files. I found this helpful when I had no project on the Sonar server available.


1 Answers

Sonarlint and pylint are comparable, in a way.

Sonarlint is a code linter and pylint is too. I haven't used sonarlint, but it seems that analyzes the code a bit deeper that pylint does. From my experience, pylint only follows a set of rules (that you can modify, by the way), while sonarlint goes a bit further analyzing the inner workings of your code. They are both static analyze tools, however.

Sonarcube, on the other hand, does a bit more. Sonarcube is a CI/CD tool that runs static linters, but also shows you code smells, and does a security analysis. All of what I'm saying is based purely on their website.

If you would like to run CI/CD workflows or scripts, you would use Sonarcube, but for local coding, sonarlint is enough. Pylint is the traditional way, though.

like image 169
Nicolas Quiroz Avatar answered Oct 04 '22 13:10

Nicolas Quiroz