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.12.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 997ecc2f49bc9b9926e81780017e7b94a6e0a575e0731f45a4fec6fd7f5fd0ae |
|
MD5 | 78d826be8a2c6ee3e2d9383dc43169cd |
|
BLAKE2b-256 | 9cd8e9c90d56ddbe9777ef05ef92e51f3080ac01d169897fd2c0981c8231f8f6 |
Close
Hashes for mypy_gitlab_code_quality-0.0.12-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 789fe6ce21a67ca3103c937da9c93da4a5d762e06f4394b5b3f6702f3a46b048 |
|
MD5 | 34549701bc688c7b4e2314d415ec6833 |
|
BLAKE2b-256 | a1a11c44b389020b0ae49cab9dfb1898ad0cfb34b1851988e3b289fd404ab341 |