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
This commit is contained in:
John Bampton
2025-07-31 01:34:26 +10:00
parent 8e074f185b
commit a35b7d537a
2 changed files with 5 additions and 0 deletions
+2
View File
@@ -25,6 +25,8 @@ jobs:
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
- name: Run pre-commit
run: pre-commit run --all-files
- name: Run manual pre-commit hooks
run: pre-commit run --all-files --hook-stage manual
ls-lint:
name: Run ls-lint
runs-on: ubuntu-latest
+3
View File
@@ -26,6 +26,7 @@ repos:
files: \.(json|md|ya?ml)$
language: node
additional_dependencies: ["prettier@3.6.2"]
stages: [manual]
- repo: https://github.com/gitleaks/gitleaks
rev: v8.27.2
hooks:
@@ -39,6 +40,7 @@ repos:
name: run oxipng
description: use lossless compression to optimize PNG files
args: ["--fix", "-o", "4", "--strip", "safe", "--alpha"]
stages: [manual]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
@@ -106,6 +108,7 @@ repos:
name: run markdown-link-check
description: checks hyperlinks in Markdown files
args: [--config=.github/linters/mlc_config.json, -q]
stages: [manual]
types: [markdown]
files: \.md$
- repo: https://github.com/rubocop/rubocop