'Use pylint with sonarqube

I apologize in advance.I have a task to create CI pipeline in Gitlab for projects on python language with results in SonarQube. I found some gitlab-ci.yml file:

image: image-registry/gitlab/python

before_script:
  - cd ..
  - git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab/python-education/junior.git

stages:
  - PyLint

pylint:
  stage: PyLint
  only:
    - merge_requests
  script:
    - cp -R ${CI_PROJECT_NAME}/* junior/project
    - cd junior && python3 run.py --monorepo

Is it possible to some code in script to output in SonarQube?



Solution 1:[1]

Yes, third party issues are supported with SonarQube. For PyLint, you can set sonar.python.pylint.reportPath in your sonar.properties file with the path of the report(s) for pylint. You must use --output-format=parseable argument to pylint.

When you run sonar scanner, it will collect the report(s) and send it to SonarQube.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 sytech