pylint-gitlab

2.1.1 · active · verified Mon Apr 13

pylint-gitlab provides custom Pylint formatters for seamless integration with GitLab CI/CD, enabling the generation of Code Quality reports and GitLab Pages HTML reports from Pylint's linting results. The current version is 2.1.1, released in November 2025, and the project has an active, though somewhat irregular, release cadence.

Warnings

Install

Imports

Quickstart

This GitLab CI/CD configuration demonstrates how to integrate `pylint-gitlab` into your pipeline. It installs the library, creates a dummy Python file with a simple linting issue, runs Pylint using the `GitlabCodeClimateReporter` to generate a `codeclimate.json` file, and then declares this file as a `codequality` artifact, which GitLab will parse to display code quality metrics in merge requests.

# .gitlab-ci.yml
image: python:3.9-slim

pylint_job:
  stage: test
  before_script:
    - pip install pylint-gitlab
    - mkdir -p public # For HTML report if used
  script:
    - |-
      # Create a dummy Python file to lint
      echo "def func():\n  x = 1\n  return x" > my_module.py
      # Run pylint with the GitLab Code Climate reporter
      pylint --exit-zero --output-format=pylint_gitlab.GitlabCodeClimateReporter my_module.py > codeclimate.json
  artifacts:
    reports:
      codequality: codeclimate.json

view raw JSON →