on: [push, pull_request]
jobs:
- build:
+ python:
+ name: "Python Tests"
+
+ runs-on: ubuntu-20.04
+
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v3
+
+ - name: pre-commit checks - setup cache
+ uses: actions/cache@v3
+ with:
+ path: ~/.cache/pre-commit
+ key: pre-commit|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
+
+ - name: pre-commit checks - run checks
+ uses: pre-commit/action@v3.0.0
+
+ C:
+ name: "C Builds"
strategy:
matrix:
--- /dev/null
+# See https://pre-commit.com for more information
+# See https://pre-commit.com/hooks.html for more hooks
+#
+
+fail_fast: false
+default_stages: [commit, push]
+repos:
+
+- repo: https://github.com/pre-commit/pre-commit-hooks
+ rev: v4.5.0
+ # https://pre-commit.com/hooks.html
+ hooks:
+ - id: check-ast
+ - id: check-builtin-literals
+ - id: check-case-conflict
+ - id: check-docstring-first
+ - id: check-merge-conflict
+ - id: check-symlinks
+ - id: check-yaml
+ - id: debug-statements
+ - id: destroyed-symlinks
+ - id: fix-byte-order-marker
+ - id: fix-encoding-pragma
+ - id: mixed-line-ending
+ args: ['--fix=lf']
+ - id: trailing-whitespace
+
+- repo: local
+ hooks:
+ - id: git-diff # https://github.com/pre-commit/pre-commit/issues/1712
+ name: Show not staged changes (fixups may make them too)
+ entry: git diff --exit-code
+ language: system
+ pass_filenames: false
+ always_run: true