-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
51 lines (45 loc) · 1.29 KB
/
.pre-commit-config.yaml
File metadata and controls
51 lines (45 loc) · 1.29 KB
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
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.9
hooks:
- id: ruff-format
files: ^backend/
args: [--check]
- id: ruff-check
files: ^backend/
- repo: local
hooks:
- id: frontend-lint-staged
name: frontend lint-staged
entry: bash -lc 'cd dashboard && pnpm lint-staged'
language: system
pass_filenames: false
stages: [pre-commit]
- id: frontend-typecheck
name: frontend typecheck
entry: bash -lc 'cd dashboard && pnpm typecheck'
language: system
pass_filenames: false
stages: [pre-commit]
- id: frontend-pre-push
name: frontend pre-push
entry: bash
args:
- -lc
- |
REMOTE="$1"
if [ -z "$MASTER_REF" ]; then
MASTER_REF="$REMOTE/main"
fi
if ! read LOCAL_REF LOCAL_SHA REMOTE_REF REMOTE_SHA; then
echo "NOTE: nothing to push, nothing to check"
exit 0
fi
if [ "$LOCAL_REF" = "(delete)" ]; then
echo "NOTE: deleting branch, nothing to check"
exit 0
fi
exit 0
language: system
pass_filenames: false
stages: [pre-push]