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 | mypy-gitlab-code-quality
This command send to STDOUT
generated json that can be used as Code Quality report artifact.
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 || true # "|| true" is used for preventing job fail when mypy find errors
- 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.
Contributing
Please run linters before creating merge request
pip install requirements/dev.txt
black .
mypy .
ruff .
Suggestions and merge requests are always welcome :)
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-1.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | be06b0def23b11f9ba10dda368cdb15f6320b9beb59b02d72642185630ee80e1 |
|
MD5 | 91764087b975c09f111820f2bb1a604e |
|
BLAKE2b-256 | b0f8da1b4609553ab07712490b9da8eda2de70805c113070833361aabf01ba83 |
Close
Hashes for mypy_gitlab_code_quality-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9890808b69a9e079ee852c482612c10008b39c767c96c5bab55aa9a0a4a970ba |
|
MD5 | 04ed27d1cf2081bff2d6acfcd9e52985 |
|
BLAKE2b-256 | 73dbb55c0169f6df6dc3cf7d0102a94c6bbb975b248d79385f91e0dbc2251cc5 |