forked from wandb/wandb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
147 lines (145 loc) · 4.8 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
141
142
143
144
145
146
147
# Install pre-commit hooks via `pip install pre-commit && pre-commit install`
# Exclude:
# * vendored code
# * generated protobuf files
exclude: '^(wandb/vendor|core/vendor/)|\.pb\.go$|_pb2\.pyi?$'
default_stages:
- pre-push
default_install_hook_types: [pre-push, pre-commit]
repos:
# - repo: https://github.com/doublify/pre-commit-rust
# rev: v1.0
# hooks:
# - id: clippy
# args: ['--manifest-path=experimental/client-rust/Cargo.toml', '--all', '--']
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.6.4"
hooks:
- id: ruff
args: [ --fix]
- id: ruff-format
- repo: https://github.com/asottile/blacken-docs
rev: 1.18.0
hooks:
- id: blacken-docs
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v18.1.8
hooks:
- id: clang-format
types_or: [proto]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-merge-conflict
- id: trailing-whitespace
name: trailing-whitespace
exclude: ^(wandb/|tests/|src/|.bumpversion.*.cfg)
- 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/|landfill/)
- id: check-executables-have-shebangs
name: check-executables-have-shebangs
exclude: ^(wandb/|tests/|landfill/)
- 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: local
hooks:
- id: generate-stubs
name: 'generate-stubs'
entry: python tools/generate_stubs.py
language: 'system'
pass_filenames: false
always_run: true
description: "Generates stubs for wandb module"
- id: go-generate-proto
name: 'go-generate-proto'
entry: core/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: core/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: core/scripts/pre-commit-hooks/run-go-fmt.sh
files: '\.go$'
language: 'script'
description: "Runs `gofmt`, requires golang"
- id: go-imports
name: 'go-imports'
entry: core/scripts/pre-commit-hooks/run-go-imports.sh
files: '\.go$'
language: 'script'
description: "Runs `goimports`, requires golang"
- id: go-unit-tests
name: 'go-unit-tests'
entry: core/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: core/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: core/scripts/pre-commit-hooks/run-golangci-lint.sh
types: [go]
language: 'script'
pass_filenames: false
- id: go-critic
name: 'go-critic'
entry: core/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: core/scripts/pre-commit-hooks/run-go-cyclo.sh
files: '\.go$'
language: 'script'
description: "Runs `gocyclo`, requires https://github.com/fzipp/gocyclo"
args:
- -over=21
- id: go-mod-tidy
name: 'go-mod-tidy'
entry: core/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: core/scripts/pre-commit-hooks/run-go-build.sh
files: '\.go$'
language: 'script'
description: "Runs `go build`, requires golang"