Skip to content

Commit a35b7d5

Browse files
committed
pre-commit: run markdown-link-check, oxipng, prettier manually
The "manual" stage in pre-commit refers to a specific hook stage designed for hooks that are not intended to run automatically during a standard git commit operation. Instead, these hooks are meant to be triggered explicitly by a user, typically when performing a full repository scan or a specific check. This speeds up the standard `pre-commit run --all-files` run by not running these two hooks. Both hooks are time consuming Can run the manual hooks with: `pre-commit run --all-files --hook-stage manual` Add pre-commit manual stage run on CI to keep full coverage
1 parent 8e074f1 commit a35b7d5

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

.github/workflows/lint.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ jobs:
2525
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
2626
- name: Run pre-commit
2727
run: pre-commit run --all-files
28+
- name: Run manual pre-commit hooks
29+
run: pre-commit run --all-files --hook-stage manual
2830
ls-lint:
2931
name: Run ls-lint
3032
runs-on: ubuntu-latest

.pre-commit-config.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ repos:
2626
files: \.(json|md|ya?ml)$
2727
language: node
2828
additional_dependencies: ["prettier@3.6.2"]
29+
stages: [manual]
2930
- repo: https://github.com/gitleaks/gitleaks
3031
rev: v8.27.2
3132
hooks:
@@ -39,6 +40,7 @@ repos:
3940
name: run oxipng
4041
description: use lossless compression to optimize PNG files
4142
args: ["--fix", "-o", "4", "--strip", "safe", "--alpha"]
43+
stages: [manual]
4244
- repo: https://github.com/pre-commit/pre-commit-hooks
4345
rev: v5.0.0
4446
hooks:
@@ -106,6 +108,7 @@ repos:
106108
name: run markdown-link-check
107109
description: checks hyperlinks in Markdown files
108110
args: [--config=.github/linters/mlc_config.json, -q]
111+
stages: [manual]
109112
types: [markdown]
110113
files: \.md$
111114
- repo: https://github.com/rubocop/rubocop

0 commit comments

Comments
 (0)