-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
132 lines (122 loc) · 3.78 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
132 lines (122 loc) · 3.78 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
120
121
122
123
124
125
126
127
128
129
130
131
132
---
# Pre-commit hooks configuration
# Install: pre-commit install
# Update: pre-commit autoupdate
# Run: pre-commit run --all-files
#
# Notes:
# - This repo is Go-focused; Python-specific format/lint hooks are intentionally omitted.
# - ggshield is configured for pre-push; set GITGUARDIAN_API_KEY to enable it.
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: trailing-whitespace
name: Trim trailing whitespace
- id: end-of-file-fixer
name: Fix end-of-file newline
- id: check-yaml
name: Check YAML syntax
- id: check-json
name: Check JSON syntax
- id: check-merge-conflict
name: Check for merge conflict markers
- id: detect-private-key
name: Detect Private Keys
- id: detect-aws-credentials
name: Detect AWS Credentials
args: [--allow-missing-credentials]
- id: mixed-line-ending
name: Normalize line endings (LF)
args: [--fix=lf]
- id: check-added-large-files
name: Check added large files
- id: check-executables-have-shebangs
name: Check executables have shebangs
- id: check-symlinks
name: Check symlinks
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.47.0
hooks:
- id: markdownlint
name: Markdownlint
args: ["--config", ".markdownlint.yaml"]
files: ^(README\.md|docs/.*\.md|\.github/.*\.md)$
- repo: https://github.com/adrienverge/yamllint
rev: v1.38.0
hooks:
- id: yamllint
name: YAML Lint
args: ["-c", ".yamllint.yaml"]
files: \.(yaml)$
- repo: https://github.com/rhysd/actionlint
rev: v1.7.10
hooks:
- id: actionlint
name: Actionlint (GitHub Actions)
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.11.0.1
hooks:
- id: shellcheck
name: ShellCheck (shell linter)
files: \.sh$
args: [--severity=warning]
- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.12.0-2
hooks:
- id: shfmt
name: shfmt (shell formatter)
files: \.sh$
args: ["-l", "-w", "-i", "2"]
# Enforce commit message rules from .commitlintrc.yaml at commit time
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v9.24.0
hooks:
- id: commitlint
name: Commitlint
stages: [commit-msg]
# Validate GitHub workflow + Dependabot YAML schemas
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.36.1
hooks:
- id: check-github-workflows
name: Validate GitHub workflows
stages: [pre-push]
- id: check-dependabot
name: Validate Dependabot config
stages: [pre-push]
# Go-specific local hooks
- repo: local
hooks:
- id: gofmt
name: Go fmt (gofmt -s)
language: system
entry: bash -c 'gofmt -s -w .'
pass_filenames: false
files: \.go$
- id: go-vet
name: Go vet
language: system
entry: bash -c 'go vet ./...'
pass_filenames: false
stages: [pre-push]
- id: go-test-race
name: Go test (race)
language: system
entry: bash -c 'go test -race ./...'
pass_filenames: false
stages: [pre-push]
- id: go-mod-tidy-check
name: Go mod tidy consistency check
language: system
entry: bash -c 'go mod tidy && git diff --exit-code go.mod go.sum'
pass_filenames: false
stages: [pre-push]
# Secret scanning (requires GitGuardian API key in environment)
- repo: https://github.com/gitguardian/ggshield
rev: v1.47.0
hooks:
- id: ggshield
name: Secret Scan (ggshield)
language_version: python3
stages: [pre-push]