Linting in Azure DevOps Pipeline

Our DevOps team have setup some pipelines for our Python projects and added a cli step for pylint. I’m confused by this as we analyse our code with SonarCloud in the pipeline & have setup SonarLint in our IDEs.

If we are running the analysis does this pick up on everything that a linter would too (pylint is flagging other things) or do we need this separate process? If we do need it can I not use SonarLint in Azure DevOps so that the CI/CD pipeline is in sync with my local environment?

A few questions to help you:

  • What are you trying to accomplish? Consistent linting
  • Why does this matter to you? To make my code base consistent reliable and readable
  • How would that look in SonarLint? Alternatives? The process runs in the IDE and in the pipeline, failing a build if exceptions are found
  • How would we know it works well? Because inconsistencies are caught
  • Why should it be a priority now? Yes

Hi,

Welcome to the community!

It’s quite possible that Pylint is reporting different things than our analysis. If you’d like to import your Pylint report into SonarCloud, you can do that with sonar.python.pylint.reportPaths.

You can not. SonarLint is an IDE plugin. It runs (as subset of) the same rules that are run by SonarCloud, so fortunately, there’s no need.

 
HTH,
Ann