forked from determined-ai/determined
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
109 lines (104 loc) · 3.18 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
---
# 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/src/'
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/)
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
- 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
rev: 21.7b0
hooks:
- id: black
# known issue fixed in a newer version:
# https://github.com/psf/black/issues/2964#issuecomment-1080974737
additional_dependencies: ['click==8.0.4']
exclude: ^(harness/determined/common/api/bindings.py)
# - 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