-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
117 lines (114 loc) · 4.09 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
117 lines (114 loc) · 4.09 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
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
fail_fast: true
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.12.10
hooks:
- id: ruff-format
args: [--check]
files: ^python/
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
files: ^python/
- repo: local
hooks:
# ── Go ──────────────────────────────────────────────────────────────
- id: gofmt
name: gofmt
entry: bash -c 'cd go && files=$(gofmt -l .); [ -z "$files" ] || gofmt -l -w $files'
language: system
files: ^go/.*\.go$
pass_filenames: false
priority: 10
- id: govet
name: go vet
entry: bash -c 'cd go && go vet ./...'
language: system
files: ^go/.*\.go$
pass_filenames: false
priority: 20
- id: gotest
name: go test
entry: bash -c 'cd go && go test ./...'
language: system
files: ^go/.*\.go$
pass_filenames: false
require_serial: true
priority: 30
# ── JS SDK (js/) ────────────────────────────────────────────────────
# Mirrors release-npm.yml: lint → type-check → build → test. The build
# step is required because CLI tests consume @phala/cloud via workspace
# link to js/dist; a stale or missing js/dist masks real failures and
# also breaks downstream cli tests when js code is the thing that changed.
- id: biome-js
name: Biome (JS SDK)
entry: bash -c 'cd js && bun run lint'
language: system
files: ^js/
types_or: [javascript, ts, tsx, jsx]
pass_filenames: false
priority: 10
- id: typecheck-js
name: TypeScript (JS SDK)
entry: bash -c 'cd js && bun run type-check'
language: system
files: ^js/
types_or: [javascript, ts, tsx, jsx]
pass_filenames: false
priority: 20
- id: build-js
name: Build (JS SDK)
entry: bash -c 'cd js && bun run build'
language: system
files: ^js/
types_or: [javascript, ts, tsx, jsx]
pass_filenames: false
require_serial: true
priority: 25
- id: test-js
name: JS SDK tests
entry: bash -c 'cd js && bun run test'
language: system
files: ^js/
types_or: [javascript, ts, tsx, jsx]
pass_filenames: false
require_serial: true
priority: 30
# ── CLI (cli/) ──────────────────────────────────────────────────────
# Mirrors release-npm.yml: lint → type-check → build → test. CLI tests
# spawn `bun cli/dist/index.js --help` for interface-compat checks, so
# the build step is mandatory — without it dist/index.js is missing and
# all the spawn-based tests silently fail with empty stdout.
- id: biome-cli
name: Biome (CLI)
entry: bash -c 'cd cli && bun run lint'
language: system
files: ^cli/
types_or: [javascript, ts, tsx, jsx]
pass_filenames: false
priority: 10
- id: typecheck-cli
name: TypeScript (CLI)
entry: bash -c 'cd cli && bun run type-check'
language: system
files: ^cli/
types_or: [javascript, ts, tsx, jsx]
pass_filenames: false
priority: 20
- id: build-cli
name: Build (CLI)
entry: bash -c 'cd cli && bun run build'
language: system
files: ^cli/
types_or: [javascript, ts, tsx, jsx]
pass_filenames: false
require_serial: true
priority: 25
- id: test-cli
name: CLI tests
entry: bash -c 'cd cli && bun run test'
language: system
files: ^cli/
types_or: [javascript, ts, tsx, jsx]
pass_filenames: false
require_serial: true
priority: 30