-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
71 lines (64 loc) · 2.02 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
71 lines (64 loc) · 2.02 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
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
# General hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-json
exclude: "testdata/invalid_json\\.json$"
- id: check-added-large-files
args: ["--maxkb=1000"]
- id: check-merge-conflict
- id: detect-private-key
# Go formatting
- repo: https://github.com/dnephin/pre-commit-golang
rev: v0.5.1
hooks:
- id: go-fmt
- id: go-mod-tidy
- id: go-build
- id: go-unit-tests
# Go imports (local hook for reliable PATH handling)
- repo: local
hooks:
- id: go-imports
name: goimports
entry: bash -c 'export PATH="$PATH:$HOME/go/bin" && goimports -local github.com/kbrdn1/LazyCurl -w "$@"' --
language: system
types: [go]
pass_filenames: true
# golangci-lint v2
- repo: https://github.com/golangci/golangci-lint
rev: v2.8.0
hooks:
- id: golangci-lint
args: ["--timeout=5m", "--new-from-rev=origin/main"]
# Conventional commits with gitmoji support
- repo: local
hooks:
- id: conventional-pre-commit
name: Conventional Commit
entry: bash -c 'tools/check-commit-msg.sh "$1"' --
language: system
stages: [commit-msg]
always_run: true
# Markdown
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.42.0
hooks:
- id: markdownlint
args: ["--fix", "--disable", "MD013", "MD024", "MD029", "MD033", "MD036", "MD040", "MD041", "MD045", "MD051", "MD056", "--"]
# YAML
- repo: https://github.com/adrienverge/yamllint
rev: v1.35.1
hooks:
- id: yamllint
args: ["-d", "{extends: relaxed, rules: {line-length: disable}}"]
# Configuration
ci:
autofix_commit_msg: "style: auto-fix by pre-commit hooks"
autoupdate_commit_msg: "chore: update pre-commit hooks"