-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
119 lines (99 loc) · 3.01 KB
/
.pre-commit-config.yaml
File metadata and controls
119 lines (99 loc) · 3.01 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# Pre-commit hooks for LDAP Manager
# Ensures code quality and consistency before commits
repos:
# Go-specific hooks
- repo: https://github.com/tekwizely/pre-commit-golang
rev: v1.0.0-rc.1
hooks:
# Go formatting
- id: go-fmt-goimports
name: Format Go code with goimports
files: \.go$
# Go module maintenance
- id: go-mod-tidy
name: Tidy Go modules
# Go building to catch compilation errors
- id: go-build-mod
name: Build Go modules
# Go testing
- id: go-test-mod
name: Run Go tests
args: [-short, -race]
# Go linting with golangci-lint
- id: golangci-lint-mod
name: Run golangci-lint
args: [--config=.golangci.yml]
# Security scanning
- repo: https://github.com/Yelp/detect-secrets
rev: v1.4.0
hooks:
- id: detect-secrets
name: Detect secrets
args: ["--baseline", ".secrets.baseline"]
exclude: (package-lock\.json|pnpm-lock\.yaml|go\.sum)$
# General file checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
# Prevent committing large files
- id: check-added-large-files
args: ["--maxkb=1024"]
# Check for merge conflict markers
- id: check-merge-conflict
# Check JSON syntax
- id: check-json
# Check YAML syntax
- id: check-yaml
args: ["--multi", "--allow-multiple-documents"]
# Check TOML syntax
- id: check-toml
# Check for private keys
- id: detect-private-key
# Ensure files end with newline
- id: end-of-file-fixer
exclude: \.min\.(js|css)$
# Remove trailing whitespace
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
exclude: \.min\.(js|css)$
# Docker linting
- repo: https://github.com/hadolint/hadolint
rev: v2.12.0
hooks:
- id: hadolint-docker
name: Lint Dockerfile
files: Dockerfile.*
# Shell script linting
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.9.0.6
hooks:
- id: shellcheck
name: Check shell scripts
files: \.(sh|bash)$
# Markdown linting
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.37.0
hooks:
- id: markdownlint
name: Lint Markdown files
args: ["--fix"]
exclude: node_modules/
# Frontend code formatting (if applicable)
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.3
hooks:
- id: prettier
name: Format frontend code
files: \.(js|ts|css|scss|json|yaml|yml|md)$
exclude: (pnpm-lock\.yaml|package-lock\.json|\.min\.(js|css)|.*_templ\.go)$
# Global configuration
ci:
autofix_commit_msg: |
[pre-commit.ci] auto fixes from pre-commit hooks
for more information, see https://pre-commit.ci
autofix_prs: true
autoupdate_branch: ""
autoupdate_commit_msg: "[pre-commit.ci] pre-commit autoupdate"
autoupdate_schedule: weekly
skip: []
submodules: false