-
Notifications
You must be signed in to change notification settings - Fork 7
/
.pre-commit-config.yaml
127 lines (112 loc) · 3.51 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
ci:
autoupdate_schedule: quarterly
default_stages: [commit]
default_install_hook_types: [pre-commit, commit-msg]
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
hooks:
- id: check-case-conflict
- id: check-yaml
- id: end-of-file-fixer
exclude: (excalidraw|CdbGQL|schema\.graphql)
- id: mixed-line-ending
- id: trailing-whitespace
exclude: (\.approved\.|__snapshots__)
- id: no-commit-to-branch
name: "don't commit to main"
args: [--branch, main]
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.257
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
args: [--target-version=py310]
- repo: local
hooks:
- id: app-prettier
name: run prettier (app)
language: system
files: ^app/.*$
types_or: [javascript, ts, svelte]
entry: |
bash -c 'npm --prefix app run fix:prettier --write "${@#*/}"' --
- id: app-check
name: run svelte-check (app)
language: system
files: ^app/.*$
types_or: [javascript, ts, svelte]
pass_filenames: false
entry: |
bash -c 'npm --prefix app run check' --
- id: app-eslint
name: run eslint (app)
language: system
files: ^app/.*$
types_or: [javascript, ts, svelte]
exclude: /_gen/
entry: |
bash -c 'npm --prefix app run fix:eslint "${@#*/}"' --
- id: app-elm-compile
name: run elm make on all Main.elm
language: system
files: ^app/.*\.elm$
pass_filenames: false
entry: |
./scripts/all-elm-compiles.sh
- id: app-elm-review
name: run elm-review (app)
language: system
files: ^app/.*\.elm$
pass_filenames: false
entry: |
bash -c 'yes Y | npm --prefix app run lint:elm-review -- --fix-all' --
- id: backend-poetry-check
name: poetry check (backend)
language: system
files: ^backend/(pyproject\.toml|poetry\.lock)$
pass_filenames: false
entry: |
bash -ec 'cd backend
# look for poetry version number on the first line of poetry.lock
if ! head -1 poetry.lock | fgrep -q "$(poetry --version|sed -E "s/[^0-9.]//g")"; then
echo "Poetry version mismatch!"
exit 1
fi
poetry lock --check'
- id: e2e-prettier
name: run prettier (e2e)
language: system
files: ^e2e/.*$
types_or: [javascript]
entry: |
bash -c 'npm --prefix e2e run fix:prettier "${@#*/}"' --
- id: e2e-eslint
name: run eslint (e2e)
language: system
files: ^e2e/.*$
types_or: [javascript]
entry: |
bash -c 'npm --prefix e2e run fix:eslint "${@#*/}"' --
- id: check-hasura-version
name: ensure hasura version consistency
language: system
pass_filenames: false
files: |
(?x)^(
docker-compose.yaml|
docker-compose-test.yaml|
hasura/.hasura_version|
)
entry: |
./scripts/check-hasura-version
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: "v8.0.0"
hooks:
- id: commitlint
stages: [commit-msg]
additional_dependencies: ["@commitlint/config-conventional"]