-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
73 lines (67 loc) · 1.83 KB
/
.pre-commit-config.yaml
File metadata and controls
73 lines (67 loc) · 1.83 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
# Pre-commit framework configuration
# Install: pip install pre-commit
# Setup: pre-commit install
# Run manually: pre-commit run --all-files
#
# This provides more advanced scanning than the basic .githooks/pre-commit script
repos:
# Gitleaks - Secret detection
- repo: https://github.com/gitleaks/gitleaks
rev: v8.18.2
hooks:
- id: gitleaks
# General file checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-added-large-files
args: ['--maxkb=1024']
- id: check-case-conflict
- id: check-merge-conflict
- id: check-yaml
- id: check-json
- id: end-of-file-fixer
- id: trailing-whitespace
- id: mixed-line-ending
- id: detect-private-key
# PowerShell validation
- repo: local
hooks:
- id: powershell-syntax
name: PowerShell Syntax Check
entry: pwsh -NoProfile -Command
args:
- |
$errors = 0
Get-ChildItem -Filter *.ps1 -Recurse | ForEach-Object {
try {
$null = [System.Management.Automation.PSParser]::Tokenize((Get-Content $_.FullName -Raw), [ref]$null)
} catch {
Write-Host "[-] Syntax error in $($_.Name): $_"
$errors++
}
}
exit $errors
language: system
files: \.ps1$
pass_filenames: false
# Bash validation with shellcheck
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.9.0.6
hooks:
- id: shellcheck
args: ['-S', 'warning']
# Markdown linting
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.39.0
hooks:
- id: markdownlint
args: ['--fix']
# Exclude patterns
exclude: |
(?x)^(
\.claude/.*|
\.vscode/.*|
logs/.*|
.*\.log
)$