-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
53 lines (48 loc) · 1.44 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
53 lines (48 loc) · 1.44 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
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: no-commit-to-branch
args: [--branch, main]
- id: check-merge-conflict
- id: detect-private-key
- id: trailing-whitespace
- id: check-added-large-files
args: [--maxkb=1024]
- id: end-of-file-fixer
- id: check-ast
- id: debug-statements
- id: check-json
- id: check-yaml
- repo: https://github.com/gitleaks/gitleaks
rev: v8.18.4
hooks:
- id: gitleaks
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.9
hooks:
- id: ruff
args: [--fix]
- id: ruff-format
- repo: local
hooks:
- id: no-bypass-patterns
name: Block AI bypass patterns
language: pygrep
entry: '(?i)(simplified version|quick version|TODO:\s*integrate|skip validation)'
types: [python]
- id: no-wip-commit
name: Block WIP commits
language: pygrep
entry: '^(wip|WIP)\b'
stages: [commit-msg]
- id: commit-msg-length
name: Subject line ≤ 72 chars
language: system
entry: >-
bash -c
'line=$(head -1 "$1");
len=${#line};
if [ -z "${line// }" ]; then echo "❌ Empty commit message"; exit 1; fi;
if [ "$len" -gt 72 ]; then echo "❌ Subject too long ($len chars, max 72)"; exit 1; fi' --
stages: [commit-msg]