-
Notifications
You must be signed in to change notification settings - Fork 359
/
.pre-commit-config.yaml
143 lines (139 loc) · 4.56 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
---
# docs: https://pre-commit.com/#creating-new-hooks
repos:
- repo: local
hooks:
- id: web-js-lint-check
name: Web JS Lint Check
entry: ./pre-commit/web_lint_check.py js
language: system
files: '^webui/react/'
types_or: [javascript, jsx, ts, tsx]
stages:
- commit
- id: web-css-lint-check
name: Web CSS Lint Check
entry: ./pre-commit/web_lint_check.py css
language: system
files: '^webui/react/src/'
types_or: [css, less, scss]
stages:
- commit
- id: web-misc-lint-check
name: Web Misc Lint Check
entry: ./pre-commit/web_lint_check.py misc
language: system
files: '^webui/react/'
types_or: [markdown, json]
stages:
- commit
- id: shell-fmt-docker
name: shfmt
description: Format shell scripts with shfmt
entry: mvdan/shfmt:v3
language: docker_image
exclude: ^(webui/react/src/services/api-ts-sdk/|hpc-ard-launcher-go/launcher/)
types:
- file
- shell
exclude_types:
- zsh
args: [-w, -s, -l, -i, '4', -ci, -bn]
stages:
- commit
- id: local-checks
name: Run local checks
description: run all local checks and format based on the directories changed.
stages:
- push
entry: ./pre-commit/check.py
require_serial: true
language: python
# golang hooks based on https://github.com/Bahjat/pre-commit-golang
- id: go-fmt-import
name: "go import/fmt"
entry: ./pre-commit/run-go-fmt-import.sh
files: '\.go$'
language: "script"
description: "Runs `goimport,gofmt`, requires golang"
exclude: ^(proto/pkg|hpc-ard-launcher-go/launcher/)
- id: gofumpt
name: "gofumpt"
entry: ./pre-commit/run-go-gofumpt.sh
files: '\.go$'
language: "script"
description: "Runs `gofumpt`, requires github.com/mvdan/gofumpt"
exclude: ^(proto/pkg|hpc-ard-launcher-go/launcher)
- id: golangci-lint
name: "go golangci-lint"
entry: ./pre-commit/run-golangci-lint.sh
files: '\.go$'
language: "script"
description: "Runs `golangci-lint`, install https://github.com/golangci/golangci-lint"
exclude: ^(proto/pkg|hpc-ard-launcher-go/launcher/)
require_serial: true
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.28.0
hooks:
- id: yamllint
files: >
(?x)^(
.github/
| .pre-commit-config.yaml
)$
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.19.2
hooks:
- id: check-dependabot
- id: check-github-actions
- id: check-github-workflows
- repo: https://github.com/psf/black
# Note: this should be kept in sync with the version in `requirements.txt`.
rev: 23.3.0
hooks:
- id: black
exclude: ^(harness/determined/common/api/bindings.py)
- repo: https://github.com/pycqa/flake8
# Note: this should be kept in sync with the version in `requirements.txt`.
rev: 3.9.2
hooks:
- id: flake8
files: ^(harness|e2e_tests)/.*
exclude: ^harness/tests/experiment/fixtures/ancient-checkpoints/.*
- repo: https://github.com/pycqa/isort
# Note: this should be kept in sync with the version in `requirements.txt`.
rev: 5.11.5
hooks:
- id: isort
name: isort (python)
exclude: ^examples/deepspeed/.*
# - repo: https://github.com/jumanjihouse/pre-commit-hooks
# rev: 3.0.0
# hooks:
# - id: markdownlint # Configure in .mdlrc
# exclude: >
# (?x)^(
# examples/.*
# | model_hub/examples/.*
# | (webui/react/src/shared/)?\.github/.*template\.md
# | docs/release-notes/README\.md
# )$
# - id: markdownlint
# name: special markdown lint for templates (skip header & blank lines)
# args:
# - --rules
# - ~MD002,~MD041,~MD012
# files: >
# (?x)^(
# (webui/react/src/shared/)?.github/.*template\.md
# )$
# - id: markdownlint
# # bug in markdownlint handling ul inside of ol :/
# # https://github.com/markdownlint/markdownlint/issues/313
# name: special markdown lint for release notes (bullet indentation)
# args:
# - --rules
# - ~MD007
# files: ^docs/release-notes/README\.md$
# # - id: git-check
# # - id: git-dirty