-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.pre-commit-config.yaml
66 lines (63 loc) · 1.76 KB
/
.pre-commit-config.yaml
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
repos:
# general pre-commit hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-case-conflict
- id: check-json
- id: check-toml
- id: check-xml
- id: check-yaml
args: [--allow-multiple-documents]
- id: detect-private-key
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
# license headers
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.5
hooks:
- id: insert-license
name: add license headers (go)
files: (?<!zz_generated.deepcopy)\.go$
args: [--use-current-year, --license-filepath, LICENSE_HEADER.txt, --comment-style, "//"]
- id: insert-license
name: add license headers (python)
files: (?<!__init__)\.py$
args: [--use-current-year, --license-filepath, LICENSE_HEADER.txt, --comment-style, "#"]
# go files
- repo: local
hooks:
- id: format
name: format with gofmt and goimports
entry: make fmt
language: system
pass_filenames: false
types: [go]
- repo: local
hooks:
- id: lint
name: lint with vet and golangci-lint
entry: make vet lint
language: system
pass_filenames: false
types: [go]
- repo: local
hooks:
- id: test
name: run unit tests
entry: make test
language: system
pass_filenames: false
# python files
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.2
hooks:
- id: ruff
args: [--select, I, --fix]
name: lint with ruff
types: [python]
- id: ruff-format
name: format with ruff
types: [python]