Repository navigation
Expand file tree
/
Copy pathpre-commit-hooks.example.yaml
More file actions
75 lines (66 loc) · 2.84 KB
/
Copy pathpre-commit-hooks.example.yaml
File metadata and controls
75 lines (66 loc) · 2.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# harness-tier pre-commit hooks example — if absent, copy to the host's .pre-commit-config.yaml; if present, use for reference (no auto-merge).
#
# This file only holds commit-msg lint (gitlint), push notification (teams-notify-push), and language-agnostic hygiene
# (file hygiene/shellcheck/hadolint). Per-language static analysis and module verification (lint/static/
# test/security) is performed by the layer-2 flow gate (scripts/precommit-runner.sh) based on flow-config.modules
# — those are not placed here.
#
# REST API contract testing (schemathesis) runs not in pre-commit but in the CI layer (.github/workflows/
# api-contract.yml — generated by /flow-init from flow-config.contract_test), only on collaboration/promotion branches.
default_install_hook_types: [pre-commit, commit-msg, pre-push]
repos:
# Commit message lint — 50/72 + enforces Conventional Commits (see .gitlint)
- repo: https://github.com/jorisroovers/gitlint
rev: v0.19.1
hooks:
- id: gitlint
stages: [commit-msg]
# harness-tier-owned hook — push notification (per-language static analysis/module verification moved to the layer-2 flow gate).
- repo: local
hooks:
# Teams push notification — notifies if the pushed branch maps to a registered channel (otherwise skip).
# entry is a path relative to the host repository. /flow-init copies notify-push.sh +
# teams_alert.py into .claude/harness-tier/scripts/, so it points at that path.
- id: teams-notify-push
name: Teams push notification
entry: .claude/harness-tier/scripts/notify-push.sh
language: script
stages: [pre-push]
always_run: true
pass_filenames: false
verbose: true
# File hygiene — language-agnostic common checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-yaml
files: \.(ya?ml)$
- id: check-json
files: \.json$
- id: check-toml
files: \.toml$
- id: check-merge-conflict
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
- id: end-of-file-fixer
- id: trailing-whitespace
- id: mixed-line-ending
args: [--fix=lf]
# Shell script checks
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.9.0.6
hooks:
- id: shellcheck
args: [-e, SC1091, -e, SC2086]
# (Optional) Dockerfile lint — only for projects that use Docker.
- repo: https://github.com/hadolint/hadolint
rev: v2.12.0
hooks:
- id: hadolint-docker
args: [--ignore, DL3008, --ignore, DL3009]
default_language_version:
python: python3
# Static analysis/hygiene only at commit time (at the push stage only teams-notify-push runs via stages)
default_stages: [pre-commit]
minimum_pre_commit_version: '3.0.0'