-
-
Notifications
You must be signed in to change notification settings - Fork 19
/
.pre-commit-config.yaml
110 lines (107 loc) · 3.01 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
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-added-large-files
- id: check-merge-conflict
- id: check-toml
- id: check-yaml
exclude: .*/pnpm-lock.yaml$
- id: debug-statements
- id: end-of-file-fixer
- id: trailing-whitespace
# python checks
- repo: https://github.com/psf/black
rev: 23.1.0
hooks:
- id: black
- repo: local
hooks:
- id: ruff
name: Run ruff for python files
entry: ruff check --config .ruff.toml --force-exclude --fix
language: system
"types_or": [python, pyi]
- repo: local
hooks:
- id: backend-pyright
name: Run typechecker for backend
entry: pdm run -p backend/ pyright backend/transcribee_backend
language: system
files: backend/.*
pass_filenames: false
- repo: local
hooks:
- id: worker-pyright
name: Run typechecker for worker
entry: pdm run -p worker/ pyright worker/transcribee_worker
language: system
files: worker/.*
pass_filenames: false
- repo: local
hooks:
- id: backend-openapi
name: update openapi-schema of the backend
entry: pdm run -p backend/ generate_openapi --file openapi-schema.yml
language: system
files: backend/.*
pass_filenames: false
- repo: local
hooks:
- id: backend-tests
name: run backend tests
entry: pdm run -p backend/ test
language: system
files: backend/.*
pass_filenames: false
- repo: local
hooks:
- id: backend-tests
name: run worker tests
entry: pdm run -p worker/ test
language: system
files: worker/.*
pass_filenames: false
# frontend checks
- repo: local
hooks:
- id: eslint
name: eslint
entry: pnpm --prefix frontend/ run check:eslint
language: system
files: \.[jt]sx?$ # *.js, *.jsx, *.ts and *.tsx
pass_filenames: false
- repo: local # openapi-schema typescript from the openapi-schema of the backend
hooks:
- id: openapi-typescript
name: openapi-typescript
entry: pnpm --prefix frontend/ run generate-openapi
language: system
files: backend/openapi-schema.yml
pass_filenames: false
- repo: local
hooks:
- id: tsc
name: tsc
entry: pnpm --prefix frontend/ run check:tsc
language: system
files: frontend/.*
pass_filenames: false
- repo: local
hooks:
- id: format
name: format
entry: pnpm --prefix frontend/ run format
language: system
files: frontend/.*
pass_filenames: false
- repo: local
hooks:
- id: pnpm_test
name: pnpm test
entry: pnpm --prefix frontend/ run test
language: system
files: frontend/.*
pass_filenames: false