forked from alibaba/zvec
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
62 lines (54 loc) · 1.73 KB
/
.pre-commit-config.yaml
File metadata and controls
62 lines (54 loc) · 1.73 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
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.4
hooks:
- id: ruff-check
name: Ruff (lint + fix)
args: [--config=pyproject.toml, --fix]
types_or: [python, pyi]
- id: ruff-format
name: Ruff (format)
args: [--config=pyproject.toml]
types_or: [python, pyi]
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v18.1.8
hooks:
- id: clang-format
name: clang-format (C++)
args: [--style=file, --fallback-style=none]
types_or: [c++, c]
exclude: ^thirdparty/.*$
- repo: https://github.com/gitleaks/gitleaks
rev: v8.21.4
hooks:
- id: gitleaks
name: Detect hardcoded secrets (gitleaks)
description: Scans staged files for secrets using gitleaks rules
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v3.0.0
hooks:
- id: conventional-pre-commit
stages: [ commit-msg ]
args: [
--types, feat,fix,docs,style,refactor,test,chore,perf,ci,build,revert,
--scope-optional
]
- repo: local
hooks:
- id: branch-name-check
name: Check branch name format
entry: >-
bash -c '
branch=$(git symbolic-ref --short HEAD);
pattern="^(feat|fix|docs|refactor|test|chore)/[a-z0-9-]+$";
if [[ $branch =~ $pattern ]]; then
exit 0;
else
echo "Invalid branch name: $branch";
echo "Must match: <type>/<lower-case-hyphen-separated>";
echo "Examples: feat/user-api, fix/header-bug, chore/update-deps";
exit 1;
fi
'
language: system
stages: [ pre-push ]