stages:
  - test

default:
  image: python:3

variables:
  # GIT_SUBMODULE_STRATEGY: recursive
  # required for HTTPS authentication, see
  # https://docs.gitlab.com/ee/ci/runners/configure_runners.html#rewrite-submodule-urls-to-https
  # GIT_SUBMODULE_FORCE_HTTPS: "true"  # only applies if the runner clones

python_style:
  stage: test
  allow_failure: true
  script:
    # install and set up requirements
    - |
      python -m venv .venv
      . .venv/bin/activate
      pip -q install -r requirements.txt
      pre-commit run --all-files &> >(tee pre-commit.log)
  artifacts:
    when: on_failure
    paths:
      - pre-commit.log
