-
Notifications
You must be signed in to change notification settings - Fork 13
/
.pre-commit-config.yaml
161 lines (161 loc) · 4.81 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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
repos:
- repo: local
hooks:
- id: ghjk-resolve
name: "Resolve ghjk installs"
always_run: true
language: system
entry: bash -c 'ghjk p resolve'
pass_filenames: false
- id: poetry-lock
name: "Check poetry lock"
always_run: true
language: system
entry: bash -c 'poetry check --lock'
pass_filenames: false
- id: poetry-lock-typegraph
name: "Check typegraph poetry lock"
always_run: true
language: system
entry: bash -c 'poetry -C ./typegraph/python check --lock'
pass_filenames: false
- id: sed-lock
name: "Lock versions"
always_run: true
language: system
entry: bash -c 'ghjk x lock-sed --check'
pass_filenames: false
- id: deno-fmt
name: Deno format
language: system
entry: bash -c 'deno fmt'
pass_filenames: false
types:
- javascript
- ts
- tsx
- json
- yaml
- id: deno-lint
name: Deno lint
language: system
entry: bash -c 'deno lint && ghjk x lint-deno'
pass_filenames: false
types:
- javascript
- ts
- tsx
- json
- yaml
files: ^(src/typegate|tools)/
- id: es-lint
name: Eslint website
language: system
entry: bash -c 'cd ./docs/metatype.dev/ && [ -f node_modules/.bin/eslint ] && pnpm lint && pnpm prettier'
pass_filenames: false
types_or:
- ts
- tsx
files: ^docs/metatype.dev
#- id: cargo-udeps
# name: Check for unused cargo dependencies
# language: system
# entry: bash -c '[ -z "${CI+x}" ] && cargo-udeps udeps'
# pass_filenames: false
# types:
# - toml
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-added-large-files
args:
- --maxkb=768
- id: check-ast
- id: check-json
exclude: .vscode/.*\.json
- id: check-toml
- id: check-yaml
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: end-of-file-fixer
# exclude all generated files
exclude: (?x)(
.ghjk/.*|
.*deno.lock|
CHANGELOG.md|
.*\.snap$|
src/typegate/src/typegraphs/.*\.json|
docs/metatype.dev/reference/|
src/pyrt_wit_wire/pyrt|
migration_lock.toml|
tests/metagen/typegraphs/sample/[rs|ts|py]/client\.[rs|ts|py]
)
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.5
hooks:
- id: insert-license
name: "License MPL-2.0 python"
args:
#- --remove-header
- --license-filepath=tools/license-header-MPL-2.0.txt
- "--comment-style=#"
- "--skip-license-insertion-comment=no-auto-license-header"
- "--skip-license-insertion-comment=@generated"
types_or:
- python
exclude: ^examples/|src/metagen/src/.*/static/.*
- id: insert-license
name: "License MPL-2.0 rust"
args:
#- --remove-header
- --license-filepath=tools/license-header-MPL-2.0.txt
- "--comment-style=//"
- "--skip-license-insertion-comment=no-auto-license-header"
- "--skip-license-insertion-comment=@generated"
types_or:
- rust
exclude: ^examples/|src/metagen/src/.*/static/.*
- id: insert-license
name: "License MPL-2.0 typescript"
args:
#- --remove-header
- --license-filepath=tools/license-header-MPL-2.0.txt
- "--comment-style=//"
- "--skip-license-insertion-comment=no-auto-license-header"
- "--skip-license-insertion-comment=@generated"
types_or:
- ts
- tsx
exclude: ^examples/|src/metagen/src/.*/static/.*
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.28.6
hooks:
- id: check-dependabot
- id: check-github-workflows
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.5.1"
hooks:
- id: ruff
- id: ruff-format
exclude: "tests/metagen/typegraphs/sample/py/client.py"
- repo: https://github.com/commitizen-tools/commitizen
rev: v3.27.0
hooks:
- id: commitizen
stages:
- commit-msg
- repo: https://github.com/doublify/pre-commit-rust
rev: v1.0
hooks:
- id: fmt
exclude: tests/metagen/typegraphs/sample/rs/client.rs
- id: clippy
args:
- "--workspace"
- "--locked"
- "--all-features"
- "--all-targets"
- "--"
- "--deny"
- "warnings"