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.15.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0258b158c35b0dd183c7c496b1e01473554d8caa0fd4715201992e345fcddb60 |
|
MD5 | 845af81476dda21c374d0bb553cc8391 |
|
BLAKE2b-256 | ad15d80c76888206c46a590318e4794901b4b4ad1076d81a96c1b1db8b64c2a2 |
Close
Hashes for mypy_gitlab_code_quality-0.0.15-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 601ecceffafc0f04b6ae89953333f03399d181ec668ae517a56c2e761042d8db |
|
MD5 | 4f59dda8d8f6a777d2ebba5800619c8b |
|
BLAKE2b-256 | 4b0b9e2c762d33ea610455463f1e69a629cf50c061fbfeed405f37425f08ab94 |