forked from wandb/wandb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
140 lines (140 loc) · 4.58 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
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
133
134
135
136
137
138
139
140
# Install pre-commit hooks via `pip install pre-commit && pre-commit install`
default_stages:
- pre-push
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.0.284"
hooks:
- id: ruff
args: [ --fix]
- repo: https://github.com/psf/black
rev: 23.7.0
hooks:
- id: black-jupyter
exclude: ^(wandb/vendor/|wandb/proto/v.*/.*_pb2\.py|wandb/proto/v.*/.*_pb2_grpc\.py|wandb/proto/wandb_deprecated.py)
- repo: https://github.com/asottile/blacken-docs
rev: 1.15.0
hooks:
- id: blacken-docs
exclude: ^(wandb/vendor/)
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v17.0.3
hooks:
- id: clang-format
types_or: [proto]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-merge-conflict
- id: trailing-whitespace
name: trailing-whitespace
exclude: ^(wandb/|tests/|src/)
- id: end-of-file-fixer
name: end-of-file-fixer
exclude: ^(wandb/|tests/|src/|.*_durations)
- id: check-yaml
name: check-yaml
exclude: ^(wandb/|tests/)
- id: check-added-large-files
name: check-added-large-files
- id: check-shebang-scripts-are-executable
name: check-shebang-scripts-are-executable
exclude: ^(wandb/|tests/)
- id: check-executables-have-shebangs
name: check-executables-have-shebangs
exclude: ^(wandb/|tests/)
- id: check-symlinks
name: check-symlinks
- id: check-toml
name: check-toml
- id: debug-statements
name: debug-statements
exclude: ^(wandb/__init__.py)
- id: forbid-submodules
name: forbid-submodules
- repo: https://github.com/psf/black
rev: 23.7.0
hooks:
- id: black
files: '^nexus/'
- repo: local
hooks:
- id: go-generate-proto
name: 'go-generate-proto'
entry: nexus/scripts/pre-commit-hooks/run-go-generate.sh
files: '\.proto$'
args:
- ./api/proto
pass_filenames: false
language: 'script'
description: "Runs `go generate`, requires golang"
- id: go-generate-graphql
name: 'go-generate-graphql'
entry: nexus/scripts/pre-commit-hooks/run-go-generate.sh
files: '\.graphql$'
args:
- ./api/graphql
pass_filenames: false
language: 'script'
description: "Runs `go generate`, requires golang"
- id: go-fmt
name: 'go-fmt'
entry: nexus/scripts/pre-commit-hooks/run-go-fmt.sh
files: '\.go$'
language: 'script'
description: "Runs `gofmt`, requires golang"
- id: go-imports
name: 'go-imports'
entry: nexus/scripts/pre-commit-hooks/run-go-imports.sh
files: '\.go$'
exclude: 'nexus/pkg/service/'
language: 'script'
description: "Runs `goimports`, requires golang"
- id: go-unit-tests
name: 'go-unit-tests'
entry: nexus/scripts/pre-commit-hooks/run-go-unit-tests.sh
files: '\.go$'
language: 'script'
description: "Runs `go test`"
require_serial: true
- id: go-vet
name: 'go-vet'
entry: nexus/scripts/pre-commit-hooks/run-go-vet.sh
files: '\.go$'
language: 'script'
description: "Runs `go vet`, requires golang"
require_serial: true
- id: golangci-lint
name: 'golangci-lint'
entry: nexus/scripts/pre-commit-hooks/run-golangci-lint.sh
types: [go]
language: 'script'
pass_filenames: false
- id: go-critic
name: 'go-critic'
entry: nexus/scripts/pre-commit-hooks/run-go-critic.sh
files: '\.go$'
language: 'script'
pass_filenames: false
description: "Runs `go-critic`, requires https://github.com/go-critic/go-critic"
- id: go-cyclo
name: 'go-cyclo'
entry: nexus/scripts/pre-commit-hooks/run-go-cyclo.sh
files: '\.go$'
exclude: 'nexus/pkg/service/'
language: 'script'
description: "Runs `gocyclo`, requires https://github.com/fzipp/gocyclo"
args:
- -over=21
- id: go-mod-tidy
name: 'go-mod-tidy'
entry: nexus/scripts/pre-commit-hooks/run-go-mod-tidy.sh
pass_filenames: false
language: 'script'
description: "Runs `go mod tidy -v`, requires golang"
- id: go-build
name: 'go-build'
entry: nexus/scripts/pre-commit-hooks/run-go-build.sh
files: '\.go$'
language: 'script'
description: "Runs `go build`, requires golang"