Skip to content

Commit d8b9a36

Browse files
authored
Disable actionlint hook by default when running pre-commit locally (#15061)
1 parent 85e71ba commit d8b9a36

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,8 @@ jobs:
585585
run: |
586586
echo '```console' > "$GITHUB_STEP_SUMMARY"
587587
# Enable color output for pre-commit and remove it for the summary
588-
SKIP=cargo-fmt,clippy,dev-generate-all pre-commit run --all-files --show-diff-on-failure --color=always | \
588+
# Use --hook-stage=manual to enable slower pre-commit hooks that are skipped by default
589+
SKIP=cargo-fmt,clippy,dev-generate-all pre-commit run --all-files --show-diff-on-failure --color=always --hook-stage=manual | \
589590
tee >(sed -E 's/\x1B\[([0-9]{1,2}(;[0-9]{1,2})*)?[mGK]//g' >> "$GITHUB_STEP_SUMMARY") >&1
590591
exit_code="${PIPESTATUS[0]}"
591592
echo '```' >> "$GITHUB_STEP_SUMMARY"

.pre-commit-config.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ fail_fast: false
22

33
exclude: |
44
(?x)^(
5+
.github/workflows/release.yml|
56
crates/red_knot_vendored/vendor/.*|
67
crates/red_knot_workspace/resources/.*|
78
crates/ruff_linter/resources/.*|
@@ -93,9 +94,6 @@ repos:
9394
rev: v0.9.2
9495
hooks:
9596
- id: zizmor
96-
# `release.yml` is autogenerated by `dist`; security issues need to be fixed there
97-
# (https://opensource.axo.dev/cargo-dist/)
98-
exclude: .github/workflows/release.yml
9997

10098
- repo: https://github.com/python-jsonschema/check-jsonschema
10199
rev: 0.30.0
@@ -108,9 +106,11 @@ repos:
108106
rev: v1.7.4
109107
hooks:
110108
- id: actionlint
111-
# `release.yml` is autogenerated by `dist`; issues need to be fixed there
112-
# (https://opensource.axo.dev/cargo-dist/)
113-
exclude: .github/workflows/release.yml
109+
stages:
110+
# This hook is disabled by default, since it's quite slow.
111+
# To run all hooks *including* this hook, use `uvx pre-commit run -a --hook-stage=manual`.
112+
# To run *just* this hook, use `uvx pre-commit run -a actionlint --hook-stage=manual`.
113+
- manual
114114
args:
115115
- "-ignore=SC2129" # ignorable stylistic lint from shellcheck
116116
- "-ignore=SC2016" # another shellcheck lint: seems to have false positives?

0 commit comments

Comments
 (0)