Commit fade28b2 authored by Dom Sekotill's avatar Dom Sekotill
Browse files

Add pre-commit hooks checking to CI

parent 92a7b03e
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -104,6 +104,30 @@ publish:coverage:
      - coverage


# Quality Assurance

code-analysis:
  stage: test
  variables:
    FROM_REF: $CI_DEFAULT_BRANCH
  rules:
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
      variables:
        FROM_REF: $CI_COMMIT_BEFORE_SHA
    - when: always
  before_script:
    - pip install pre-commit
  script:
    - git fetch $CI_REPOSITORY_URL $FROM_REF:FROM_REF
    - pre-commit run
      --hook-stage=commit
      --from-ref=FROM_REF
      --to-ref=${CI_COMMIT_SHA}
    - pre-commit run
      --hook-stage=push
      --from-ref=FROM_REF
      --to-ref=${CI_COMMIT_SHA}

# Lint

.lint: