---
flake8:
  stage: lint
  script:
    - flake8 --format gl-codeclimate --output-file gl-code-quality-report.json
  artifacts:
    reports:
      codequality: gl-code-quality-report.json
    when: always
  allow_failure: true

mypy:
  stage: lint
  script:
    - mypy --check-untyped-defs --no-error-summary piupartslib/ *.py | tee mypy-output.txt || return_code=$?
    - PYTHONHASHSEED=0 mypy-gitlab-code-quality < mypy-output.txt > gl-code-quality-report.json
    - exit $return_code
  artifacts:
    reports:
      codequality: gl-code-quality-report.json
    when: always
  allow_failure: true

black:
  stage: lint
  script:
    - black --check .
