From 6b683f9c5eb1e2474372454f682b0a4c476061f7 Mon Sep 17 00:00:00 2001 From: James Stevenson Date: Tue, 5 Nov 2024 10:52:19 -0500 Subject: [PATCH 1/3] cicd: check line endings --- .pre-commit-config.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0ea2558..5f76687 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,6 +9,8 @@ repos: - id: check-merge-conflict - id: detect-aws-credentials args: [ --allow-missing-credentials ] + - id: mixed-line-ending + args: [ --fix=lf ] - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.5.0 # ruff version hooks: From f52276a1b5fc55744100a99e416cc15e47f5d29f Mon Sep 17 00:00:00 2001 From: James Stevenson Date: Tue, 5 Nov 2024 10:53:07 -0500 Subject: [PATCH 2/3] check in CI --- .github/workflows/checks.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index 1d1323e..b178e49 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -22,6 +22,24 @@ jobs: - name: Run tests run: python3 -m pytest + precommit_hooks: + runs-on: ubuntu-latest + strategy: + matrix: + hook: + - name: "Check EOF format" + args: "end-of-file-fixer --all-files" + - name: "Check trailing whitespace" + args: "trailing-whitespace --all-files" + - name: "Check line ending format" + args: "mixed-line-ending --fix=lf --all-files" + steps: + - uses: actions/checkout@v3 + + - name: ${{ matrix.hook.name }} + uses: pre-commit/action@v3.0.1 + with: + extra_args: ${{ matrix.hook.args }} lint: name: lint runs-on: ubuntu-latest From 03d70d85cb7369b59abb6920cd023250d7e416f7 Mon Sep 17 00:00:00 2001 From: James Stevenson Date: Tue, 5 Nov 2024 11:01:29 -0500 Subject: [PATCH 3/3] more fix --- .github/workflows/checks.yaml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index b178e49..296cfdc 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -26,20 +26,20 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - hook: - - name: "Check EOF format" - args: "end-of-file-fixer --all-files" - - name: "Check trailing whitespace" - args: "trailing-whitespace --all-files" - - name: "Check line ending format" - args: "mixed-line-ending --fix=lf --all-files" + - cmd: "end-of-file-fixer" + - cmd: "trailing-whitespace" + - cmd: "mixed-line-ending" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + + - name: Set up Python 3.12 + uses: actions/setup-python@v5 + with: + python-version: 3.12 - - name: ${{ matrix.hook.name }} - uses: pre-commit/action@v3.0.1 + - uses: pre-commit/action@v3.0.1 with: - extra_args: ${{ matrix.hook.args }} + extra_args: ${{ matrix.cmd }} --all-files lint: name: lint runs-on: ubuntu-latest