From 728fff110abdabebffaea9bed37dceb8e81f0b71 Mon Sep 17 00:00:00 2001 From: Arthur Moore Date: Sun, 13 Oct 2024 17:26:25 -0400 Subject: [PATCH] Update Github CI and Pre-Commit hooks * Fixes CI not running. * Allows markdown files to have hard linebreaks. * Ads additional checks. --- .github/workflows/ci.yml | 15 +++------------ .pre-commit-config.yaml | 19 ++++++++++++++++++- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cc4feaf..899480c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,19 +13,10 @@ jobs: runs-on: ubuntu-latest steps: - name: 💾 Check out repository - uses: actions/checkout@v3 - - - name: 🪝 Cache pre-commit hooks - uses: actions/cache@v3 - with: - path: ~/.cache/pre-commit - key: "pre-commit-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') - }}" - + uses: actions/checkout@v4 + - uses: actions/setup-python@v3 # WARNING: This must be v3 - name: ✨ Install pre-commit - shell: bash - run: python3 -m pip install pre-commit - + uses: pre-commit/action@v3.0.1 - name: 🔥 Test run: pre-commit run --show-diff-on-failure --all-files diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5ba8a3b..a3d5efe 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,24 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v5.0.0 hooks: - id: check-merge-conflict - id: end-of-file-fixer + - id: fix-byte-order-marker - id: trailing-whitespace + args: [--markdown-linebreak-ext=md] + - id: check-case-conflict + - id: check-illegal-windows-names + - id: check-json + - id: check-yaml + #- id: name-tests-test # Ensure's pytest files end in "_test.py + - id: no-commit-to-branch # Prevent accidental commits to main + +- repo: local + hooks: + - id: no-stl + name: Forbid STL files + entry: Do not commit STL files. + language: fail + files: \.stl + types: [binary]