-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
48 lines (43 loc) · 1.33 KB
/
.pre-commit-config.yaml
File metadata and controls
48 lines (43 loc) · 1.33 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
repos:
# Local hooks for Go
- repo: local
hooks:
- id: go-fmt-import
name: Format Go code
entry: sh -c 'go run golang.org/x/tools/cmd/goimports -w .'
language: system
files: \.go$
pass_filenames: false
- id: go-lint
name: Lint Go code
entry: sh -c 'go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint run --timeout=10m'
language: system
files: \.go$
pass_filenames: false
# Standard file quality checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-yaml
name: Check YAML syntax
- id: check-toml
name: Check TOML syntax
- id: end-of-file-fixer
name: Fix end of files
- id: trailing-whitespace
name: Trim trailing whitespace
- id: check-merge-conflict
name: Check for merge conflicts
- id: check-added-large-files
name: Check for large files
args: ['--maxkb=1000']
- id: check-case-conflict
name: Check for case conflicts
- id: mixed-line-ending
name: Check for mixed line endings
# Additional security checks can be added here
# Example: detect-secrets, commitizen, etc.
# Global configuration
default_stages: [pre-commit]
fail_fast: false
minimum_pre_commit_version: '3.0.0'