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 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 > mypy-out.txt || true # "|| true" is used for preventing job fail when mypy find errors
- PYTHONHASHSEED=0 mypy-gitlab-code-quality < mypy-out.txt > 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.
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.10.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47fbfeb813372acee534007475da7bf67a32b5454b2410760d66a7b54c89073a |
|
MD5 | 7dff95a15e4fdfd0031e41e38a645134 |
|
BLAKE2b-256 | e167b341d1d83a6109d9bbd7511dc69ad3ff2781acdeb1e9b43ab87c54b6e5ad |
Close
Hashes for mypy_gitlab_code_quality-0.0.10-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3db4cbc0f6dba4b8d6ea2bcebbb85da166af2366275c9db45ddb37dc2eb62dd |
|
MD5 | dca994f1977e0cdd2f5d58dfa1597d5b |
|
BLAKE2b-256 | dbb5c9518364b8017778f29ab5475e4665649b31d124caf56ca171b68baa6eae |