Skip to main content

Simple script to generate gitlab code quality report from output of pydocstyle.

Project description

GitLab CI PyPI - Python Version PyPI - License PyPI PyPI - Downloads

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

pydocstyle-gitlab-code-quality-0.0.1.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file pydocstyle-gitlab-code-quality-0.0.1.tar.gz.

File metadata

File hashes

Hashes for pydocstyle-gitlab-code-quality-0.0.1.tar.gz
Algorithm Hash digest
SHA256 09c0358c05d26649a0faeef201a29c010ae6daaf02cbaae591eacd8da45cac5c
MD5 3e23572c4281e0bef5e468b497989c56
BLAKE2b-256 d27107b6a58ae11423db23bb662c6d36e253c2f9c299cee58c2bca26e95b9c37

See more details on using hashes here.

File details

Details for the file pydocstyle_gitlab_code_quality-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pydocstyle_gitlab_code_quality-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dd4eea9205afc21adbac3961b19021698d1d6544ff15ff69a251fb73cb36fdcf
MD5 4962527f3b79b94a6f5756d41c4a1db1
BLAKE2b-256 b55c188912606d6c56d4c03ed2a5d2e093b1e44dbf2e76859fb9e48e56ea762e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page