From 774fed2fe365c6afec3c0b7bd6b005d8d04dc301 Mon Sep 17 00:00:00 2001 From: Aolin Date: Sun, 8 Sep 2024 21:16:48 +0800 Subject: [PATCH] feat: add pre-commit (typos, check-yaml, end-of-file-fixer, trailing-whitespace) --- .github/workflows/pre-commit.yml | 14 ++++++++++++++ .pre-commit-config.yaml | 11 +++++++++++ _typos.toml | 5 +++++ 3 files changed, 30 insertions(+) create mode 100644 .github/workflows/pre-commit.yml create mode 100644 .pre-commit-config.yaml create mode 100644 _typos.toml diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 0000000..65947d3 --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,14 @@ +name: pre-commit + +on: + pull_request: + push: + branches: [main] + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + - uses: pre-commit/action@v3.0.1 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..b25b2a8 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,11 @@ +repos: + - repo: https://github.com/crate-ci/typos + rev: v1.24.5 + hooks: + - id: typos + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v2.3.0 + hooks: + - id: check-yaml + - id: end-of-file-fixer + - id: trailing-whitespace diff --git a/_typos.toml b/_typos.toml new file mode 100644 index 0000000..785f886 --- /dev/null +++ b/_typos.toml @@ -0,0 +1,5 @@ +[default] + + +[default.extend-identifiers] +levlSkipRequest = "levlSkipRequest"