-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
44 lines (40 loc) · 1.51 KB
/
.pre-commit-config.yaml
File metadata and controls
44 lines (40 loc) · 1.51 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
# Pre-commit Lite - Automated Code Formatting for OWASP wrongsecrets-binaries
# This lightweight configuration automatically fixes code formatting issues
# See https://pre-commit.com for more information
repos:
- repo: local
hooks:
# Rust - Auto-format code
- id: rust-fmt-fix
name: Rust auto-format
description: Automatically format Rust code with rustfmt
entry: bash
args: ['-c', 'cd rust && cargo fmt']
language: system
files: \.rs$
pass_filenames: false
# Go - Auto-format code and tidy modules
- id: go-fmt-fix
name: Go auto-format
description: Automatically format Go code with gofmt
entry: bash
args: ['-c', 'cd golang && gofmt -w .']
language: system
files: \.go$
pass_filenames: false
- id: go-mod-tidy
name: Go mod tidy
description: Clean up go.mod and go.sum
entry: bash
args: ['-c', 'cd golang && go mod tidy']
language: system
files: go\.(mod|sum)$
pass_filenames: false
# Basic safety checks (non-intrusive)
- id: check-merge-conflict
name: Check for merge conflicts
description: Detect merge conflict markers
entry: bash
args: ['-c', 'grep -rn "^<<<<<<< \\|^======= \\|^>>>>>>> " --include="*.rs" --include="*.go" --include="*.c" --include="*.cpp" --include="*.h" . && echo "Merge conflict markers found!" && exit 1 || true']
language: system
pass_filenames: false