Skip to main content

Simple script to generate gitlab code quality report from output of mypy.

Project description

Gitlab-CI PyPI - Python Version PyPI Downloads PyPI - License Ruff

mypy-gitlab-code-quality

Simple script to generate gitlab code quality report from output of mypy.

Example gitlab codequality report from gitlab documentation: Example gitlab codequality widget

Usage

$ mypy program.py --output=json | mypy-gitlab-code-quality

This command send to STDOUT generated json that can be used as Code Quality report artifact.

Also, this script supports plain text output parsing for backward compatability but json is recommended.

$ mypy program.py | mypy-gitlab-code-quality

Example .gitlab-ci.yml

image: python:alpine
codequality:
  script:
    - pip install mypy mypy-gitlab-code-quality
    - mypy program.py --output=json > mypy-out.json || true  # "|| true" is used for preventing job fail when mypy find errors
    - mypy-gitlab-code-quality < mypy-out.json > codequality.json
  artifacts:
    when: always
    reports:
      codequality: codequality.json

Note: if you want to use this example you should replace program.py with yours module names.

Contributing

Please run linters before creating pull request

pip install requirements/dev.txt
mypy .
ruff check
ruff format

Suggestions and pull requests are always welcome :)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mypy_gitlab_code_quality-1.3.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mypy_gitlab_code_quality-1.3.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file mypy_gitlab_code_quality-1.3.0.tar.gz.

File metadata

File hashes

Hashes for mypy_gitlab_code_quality-1.3.0.tar.gz
Algorithm Hash digest
SHA256 86e32677dbc92d7beeb85d1ea7e47f8da7a0a903959eb6a0ca3f60bf0325ca60
MD5 b08b1b53bc6ed4299b3dbfe36621d654
BLAKE2b-256 810f169f94c2b3894a4f75ff584bd578831fa4164e70787801a5f79b518af9a3

See more details on using hashes here.

File details

Details for the file mypy_gitlab_code_quality-1.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mypy_gitlab_code_quality-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 88592e84aa5c50c73aec34d02fb14952248b44903148075059fe1e7b78a501ef
MD5 b53ac89d9a6c05ae77d25cf2e48ace57
BLAKE2b-256 62b65c79f9d5b7bb7c7567ce3027877c3d4497c29939a524305cb13d7150ca6c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page