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
    - 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.2.tar.gz (4.4 kB view hashes)

Uploaded Source

Built Distribution

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