Simple script to generate gitlab code quality report from output of mypy.
Project description
mypy-gitlab-code-quality
Simple script to generate gitlab code quality report from output of mypy.
Example gitlab codequality report from gitlab documentation:
Usage
$ mypy program.py | PYTHONHASHSEED=0 mypy-gitlab-code-quality
This command send to STDOUT
generated json that can be used as Code Quality report artifact.
Note: Set environment variable PYTHONHASHSEED
to 0
to prevent randomize hashes.
Constant hashes allow gitlab to determine diff between branches on merge request.
Example .gitlab-ci.yml
image: python:alpine
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
cache:
paths:
- .cache/pip/
- venv/
- .mypy_cache/
before_script:
- python --version # For debugging
- python -m venv venv
- . venv/bin/activate
codequality:
script:
- pip install mypy mypy-gitlab-code-quality
- mypy program.py --no-error-summary > mypy-out.txt
- PYTHONHASHSEED=0 mypy-gitlab-code-quality < mypy-out.txt > codequality.json
artifacts:
when: always
reports:
codequality: codequality.json
allow_failure: true
Note: if you want to use this example you should replace program.py
with yours module names.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for mypy-gitlab-code-quality-0.0.14.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5dcb7f2a4fa8e7b01337307523fa85f16c53c6c739ee3b1f69f73a8b36b0f8a1 |
|
MD5 | 1eef915febcd8020d5f079d2786739cc |
|
BLAKE2b-256 | fef24ead89d1a95bc430b7b055a097498068837ffcef86304015ed1daf07071b |
Close
Hashes for mypy_gitlab_code_quality-0.0.14-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bdd1f251ccf960b7423bb7f6ccdf9b7c2a0c816904b1b960629b134ce3c14d86 |
|
MD5 | 90a2c75f50af15ee1d91a228aacf8a4c |
|
BLAKE2b-256 | 3c762f18646a30fb560dca04524d0c702e004494ce54949e5837439daaf01ae9 |