From d5df2c5216f8c12d05e6aff26b3815979dacdbbc Mon Sep 17 00:00:00 2001 From: Son Pham-Ba Date: Wed, 27 Nov 2024 08:35:55 +0100 Subject: [PATCH] chore: add precommit to github actions --- .github/workflows/lint.yaml | 32 ++++++++++++++++++++++++++++++++ .pre-commit-config.yaml | 7 ++++--- 2 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/lint.yaml diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 0000000..f6c166e --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,32 @@ +name: Lint + +on: + push: + branches: + - main + pull_request: + branches: + - main + workflow_dispatch: + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: "3.13" + + - name: stylua + if: success() || failure() + uses: pre-commit/action@v3.0.1 + with: + extra_args: stylua-github --all-files + + - name: codespell + if: success() || failure() + uses: pre-commit/action@v3.0.1 + with: + extra_args: codespell --all-files diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b2606eb..cfde5c3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,6 +6,7 @@ repos: hooks: - id: trailing-whitespace - id: end-of-file-fixer + - id: check-yaml - repo: https://github.com/JohnnyMorganz/StyLua rev: v2.0.1 hooks: @@ -13,9 +14,9 @@ repos: - repo: https://github.com/codespell-project/codespell rev: v2.3.0 hooks: - - id: codespell - additional_dependencies: - - tomli + - id: codespell + additional_dependencies: + - tomli - repo: https://github.com/compilerla/conventional-pre-commit rev: v3.6.0 hooks: