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.13.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 459ed585926bbda881e515149ccbe1ffcc0b4918c6faa5d37f5e5b970ee4fae2 |
|
MD5 | 1a72b702ce0551c5f74f6984679b608f |
|
BLAKE2b-256 | 36b4749688a28823b367d5a4b21d7665ee9b170fc69f1e4430e4ef64d9490b2d |
Close
Hashes for mypy_gitlab_code_quality-0.0.13-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e33cf4f621f3458cf9419e768888038896a5015f380bd3e034b38923858d8557 |
|
MD5 | 7efde6c74c37f929c105658aa4f90873 |
|
BLAKE2b-256 | de7c293d94613067ef87ca8aa65bdcc850baf49fce4f2be0e03cc8d878fe72ae |