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.11.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2e5625fbe6aabf957b4b5e0d1ea5bdafa2981ac7e300137e2d0cf0c2411c185 |
|
MD5 | 892b51e2b92307daa56119cec3853a77 |
|
BLAKE2b-256 | 4dba1cc735666d48d8af752a2caebc12c0df85440020a17d950f23240bd062ad |
Close
Hashes for mypy_gitlab_code_quality-0.0.11-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c3238267fad08abc4e6a5f6156a22361cd8366e6f71b6cf5475fee52392ed28 |
|
MD5 | 4c8d2bcbf99f6392e53766aa299b6244 |
|
BLAKE2b-256 | 39b1fd019144274dad3c5b3a58da5e09c91d26912c091c6afa1de6e97827d77c |