wandb
/
.pre-commit-config.yaml
145 строк · 4.7 Кб
1# Install pre-commit hooks via `pip install pre-commit && pre-commit install`
2default_stages:
3- pre-push
4repos:
5- repo: https://github.com/doublify/pre-commit-rust
6rev: v1.0
7hooks:
8- id: clippy
9args: ['--manifest-path=client/Cargo.toml', '--all', '--']
10- repo: https://github.com/astral-sh/ruff-pre-commit
11rev: "v0.1.0"
12hooks:
13- id: ruff
14args: [ --fix]
15- repo: https://github.com/psf/black
16rev: 23.10.0
17hooks:
18- id: black-jupyter
19exclude: ^(wandb/vendor/|wandb/proto/v.*/.*_pb2\.py|wandb/proto/v.*/.*_pb2_grpc\.py|wandb/proto/wandb_deprecated.py)
20- repo: https://github.com/asottile/blacken-docs
21rev: 1.16.0
22hooks:
23- id: blacken-docs
24exclude: ^(wandb/vendor/)
25- repo: https://github.com/pre-commit/mirrors-clang-format
26rev: v17.0.3
27hooks:
28- id: clang-format
29types_or: [proto]
30- repo: https://github.com/pre-commit/pre-commit-hooks
31rev: v4.5.0
32hooks:
33- id: check-merge-conflict
34- id: trailing-whitespace
35name: trailing-whitespace
36exclude: ^(wandb/|tests/|src/)
37- id: end-of-file-fixer
38name: end-of-file-fixer
39exclude: ^(wandb/|tests/|src/|.*_durations)
40- id: check-yaml
41name: check-yaml
42exclude: ^(wandb/|tests/)
43- id: check-added-large-files
44name: check-added-large-files
45- id: check-shebang-scripts-are-executable
46name: check-shebang-scripts-are-executable
47exclude: ^(wandb/|tests/)
48- id: check-executables-have-shebangs
49name: check-executables-have-shebangs
50exclude: ^(wandb/|tests/)
51- id: check-symlinks
52name: check-symlinks
53- id: check-toml
54name: check-toml
55- id: debug-statements
56name: debug-statements
57exclude: ^(wandb/__init__.py)
58- id: forbid-submodules
59name: forbid-submodules
60- repo: https://github.com/psf/black
61rev: 23.10.0
62hooks:
63- id: black
64files: '^core/'
65- repo: local
66hooks:
67- id: go-generate-proto
68name: 'go-generate-proto'
69entry: core/scripts/pre-commit-hooks/run-go-generate.sh
70files: '\.proto$'
71args:
72- ./api/proto
73pass_filenames: false
74language: 'script'
75description: "Runs `go generate`, requires golang"
76- id: go-generate-graphql
77name: 'go-generate-graphql'
78entry: core/scripts/pre-commit-hooks/run-go-generate.sh
79files: '\.graphql$'
80args:
81- ./api/graphql
82pass_filenames: false
83language: 'script'
84description: "Runs `go generate`, requires golang"
85- id: go-fmt
86name: 'go-fmt'
87entry: core/scripts/pre-commit-hooks/run-go-fmt.sh
88files: '\.go$'
89language: 'script'
90description: "Runs `gofmt`, requires golang"
91- id: go-imports
92name: 'go-imports'
93entry: core/scripts/pre-commit-hooks/run-go-imports.sh
94files: '\.go$'
95exclude: 'core/pkg/service/'
96language: 'script'
97description: "Runs `goimports`, requires golang"
98- id: go-unit-tests
99name: 'go-unit-tests'
100entry: core/scripts/pre-commit-hooks/run-go-unit-tests.sh
101files: '\.go$'
102language: 'script'
103description: "Runs `go test`"
104require_serial: true
105- id: go-vet
106name: 'go-vet'
107entry: core/scripts/pre-commit-hooks/run-go-vet.sh
108files: '\.go$'
109language: 'script'
110description: "Runs `go vet`, requires golang"
111require_serial: true
112- id: golangci-lint
113name: 'golangci-lint'
114entry: core/scripts/pre-commit-hooks/run-golangci-lint.sh
115types: [go]
116language: 'script'
117pass_filenames: false
118- id: go-critic
119name: 'go-critic'
120entry: core/scripts/pre-commit-hooks/run-go-critic.sh
121files: '\.go$'
122language: 'script'
123pass_filenames: false
124description: "Runs `go-critic`, requires https://github.com/go-critic/go-critic"
125- id: go-cyclo
126name: 'go-cyclo'
127entry: core/scripts/pre-commit-hooks/run-go-cyclo.sh
128files: '\.go$'
129exclude: 'core/pkg/service/'
130language: 'script'
131description: "Runs `gocyclo`, requires https://github.com/fzipp/gocyclo"
132args:
133- -over=21
134- id: go-mod-tidy
135name: 'go-mod-tidy'
136entry: core/scripts/pre-commit-hooks/run-go-mod-tidy.sh
137pass_filenames: false
138language: 'script'
139description: "Runs `go mod tidy -v`, requires golang"
140- id: go-build
141name: 'go-build'
142entry: core/scripts/pre-commit-hooks/run-go-build.sh
143files: '\.go$'
144language: 'script'
145description: "Runs `go build`, requires golang"
146