You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .pre-commit-config.yaml
+46-2Lines changed: 46 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -16,28 +16,50 @@
16
16
# under the License.
17
17
18
18
---
19
-
# https://pre-commit.com/#installation
19
+
# prek-style priority keys enables prek to run independent hooks in parallel, improving pre-commit check times.
20
+
# The priority values are assigned to structure the hook execution into logical stages, ensuring correct ordering of
21
+
# file modifications and maximum concurrency of read-only checks.
22
+
23
+
# Priority Levels: Hooks can be assigned different priority numbers. Hooks with a priority of 0 (or a higher numerical
24
+
# value, depending on configuration) run first or alongside other zero-priority hooks to decrease total end-to-end
25
+
# execution time.
26
+
27
+
# Priority Groups and Ordering Design
28
+
29
+
# | Stage / Priority | Hooks | Rationale |
30
+
# |---|---|---|
31
+
# | **Priority 10** | `identity`, `check-hooks-apply` | **Meta & Setup**: Ensure environment is valid before executing heavy checks. |
32
+
# | **Priority 20** | `fix-byte-order-marker` | **File Cleanups (Broad)**: Fix BOM first so subsequent steps work with clean UTF-8 text. |
33
+
# | **Priority 30** | `trailing-whitespace` | **Formatting (Broad)**: Cleans up whitespace on files before other hooks validate them. |
34
+
# | **Priority 40** | `doctoc`, `oxipng`, `file-contents-sorter` | **Disjoint Modifiers**: These modify different sets of files (`README.md`, `.png` files, and `codespell.txt` respectively). Running them concurrently is safe. |
# | | **Read-Only / Syntax / Security**: The bulk of the suite. These hooks only read and validate files without modifying them, allowing full parallel execution. |
37
+
38
+
# https://prek.j178.dev/installation/
20
39
default_stages: [pre-commit, pre-push]
21
40
default_language_version:
22
41
# force all unspecified Python hooks to run python3
23
42
python: python3
24
-
minimum_pre_commit_version: '3.2.0'
43
+
minimum_prek_version: '0.3.4'
25
44
repos:
26
45
- repo: meta
27
46
hooks:
28
47
- id: identity
29
48
name: run identity check
30
49
description: check you have set your git identity
50
+
priority: 10
31
51
- id: check-hooks-apply
32
52
name: run check hooks apply
33
53
description: check that all the hooks apply to the repository
0 commit comments