Skip to content

Commit

Permalink
Autocommit precommit changes (#1840)
Browse files Browse the repository at this point in the history
* Add stages to pre-commit config

* Commit if there are pre-commit related changes
  • Loading branch information
kumaranvpl authored Oct 8, 2024
1 parent 810b3bc commit d60f3bc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/pr_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ jobs:
path: ~/.cache/pre-commit
key: pre-commit|${{ hashFiles('.pre-commit-config.yaml') }}
- uses: pre-commit/action@v3.0.1
continue-on-error: true
with:
extra_args: --hook-stage manual --all-files
- name: Commit
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "fix: add missing pre-commit changes"
- uses: pre-commit/action@v3.0.1

test-basic:
if: github.event.pull_request.draft == false
Expand Down
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
default_stages: [pre-commit, pre-merge-commit]
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
stages: [pre-commit, pre-merge-commit, manual]
- id: end-of-file-fixer
stages: [pre-commit, pre-merge-commit, manual]
exclude: |
(?x)^(
docs/docs/SUMMARY.md|
docs/docs/en/api/.meta.yml
)$
- id: check-yaml
stages: [pre-commit, pre-merge-commit, manual]
exclude: 'docs/mkdocs.yml'
- id: check-added-large-files
stages: [pre-commit, pre-merge-commit, manual]

- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell
stages: [pre-commit, pre-merge-commit, manual]
args: [--ignore-words=.codespell-whitelist.txt]
exclude: |
(?x)^(
Expand All @@ -29,6 +35,7 @@ repos:
hooks:
- id: lint
name: Linter
stages: [pre-commit, pre-merge-commit, manual]
entry: "scripts/lint-pre-commit.sh"
language: python
language_version: python3.8
Expand Down

0 comments on commit d60f3bc

Please sign in to comment.