Simple script to generate gitlab code quality report from output of pydocstyle.
Project description
pydocstyle-gitlab-code-quality
Generate GitLab Code Quality report from an output of pydocstyle.
Usage
$ pydocstyle <file_path> | PYTHONHASHSEED=0 pydocstyle-gitlab-code-quality
The output of this command is printed to stdout
in JSON format, which can be used as Code Quality report.
Environment variable PYTHONHASHSEED=0
prevents randomized hashes, which are used by GitLab to determine changes between branches on merge request.
Example .gitlab-ci.yml
file
image: python:alpine
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
cache:
paths:
- .cache/pip/
- venv/
before_script:
- python --version # For debugging
- python -m venv venv
- . venv/bin/activate
codequality:
script:
- pip install pydocstyle pydocstyle-gitlab-code-quality
- pydocstyle program.py > pydocstyle-out.txt
- PYTHONHASHSEED=0 pydocstyle-gitlab-code-quality < pydocstyle-out.txt > codequality.json
artifacts:
when: always
reports:
codequality: codequality.json
allow_failure: true
Credits
This script was inspired by mypy-gitlab-code-quality. Thanks!
License
The project is licensed under MIT - a free and open-source license. For more information, please see the license file.
Project details
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
File details
Details for the file pydocstyle-gitlab-code-quality-0.0.1.tar.gz
.
File metadata
- Download URL: pydocstyle-gitlab-code-quality-0.0.1.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09c0358c05d26649a0faeef201a29c010ae6daaf02cbaae591eacd8da45cac5c |
|
MD5 | 3e23572c4281e0bef5e468b497989c56 |
|
BLAKE2b-256 | d27107b6a58ae11423db23bb662c6d36e253c2f9c299cee58c2bca26e95b9c37 |
File details
Details for the file pydocstyle_gitlab_code_quality-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: pydocstyle_gitlab_code_quality-0.0.1-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd4eea9205afc21adbac3961b19021698d1d6544ff15ff69a251fb73cb36fdcf |
|
MD5 | 4962527f3b79b94a6f5756d41c4a1db1 |
|
BLAKE2b-256 | b55c188912606d6c56d4c03ed2a5d2e093b1e44dbf2e76859fb9e48e56ea762e |