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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mypy-gitlab-code-quality-0.0.13.tar.gz.
File metadata
- Download URL: mypy-gitlab-code-quality-0.0.13.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
459ed585926bbda881e515149ccbe1ffcc0b4918c6faa5d37f5e5b970ee4fae2
|
|
| MD5 |
1a72b702ce0551c5f74f6984679b608f
|
|
| BLAKE2b-256 |
36b4749688a28823b367d5a4b21d7665ee9b170fc69f1e4430e4ef64d9490b2d
|
File details
Details for the file mypy_gitlab_code_quality-0.0.13-py3-none-any.whl.
File metadata
- Download URL: mypy_gitlab_code_quality-0.0.13-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e33cf4f621f3458cf9419e768888038896a5015f380bd3e034b38923858d8557
|
|
| MD5 |
7efde6c74c37f929c105658aa4f90873
|
|
| BLAKE2b-256 |
de7c293d94613067ef87ca8aa65bdcc850baf49fce4f2be0e03cc8d878fe72ae
|