From 6a30454dbac59657a1e4c34452186b276b7001f0 Mon Sep 17 00:00:00 2001 From: Stella Laurenzo Date: Sat, 27 Apr 2024 14:22:23 -0700 Subject: [PATCH] Enable post commit run of pre-commit hooks over all files. The pre-commit hook will only run on changed files, whereas this runs on push and will check everything. --- .github/workflows/pre-commit-all.yml | 15 +++++++++++++++ .pre-commit-config.yaml | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/pre-commit-all.yml diff --git a/.github/workflows/pre-commit-all.yml b/.github/workflows/pre-commit-all.yml new file mode 100644 index 000000000000..e17d4ebdbb43 --- /dev/null +++ b/.github/workflows/pre-commit-all.yml @@ -0,0 +1,15 @@ +name: pre-commit (all files on push) + +on: + push: + branches: [main, post-commit-test] + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + - uses: pre-commit/action@v3.0.1 + with: + extra_args: --color=always --all-files diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b7d58d956fd9..72329026f716 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ # See https://pre-commit.com for more information # See https://pre-commit.com/hooks.html for more hooks -exclude: "GeneratedTorchOps\\.td|abstract_interp_lib_gen\\.py|\\.excalidraw" +exclude: "GeneratedTorchOps\\.td|abstract_interp_lib_gen\\.py|\\.excalidraw|\\.ipynb" repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v3.2.0