forked from anomalyco/opencode
-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (54 loc) · 2.1 KB
/
typecheck.yml
File metadata and controls
60 lines (54 loc) · 2.1 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
name: typecheck
on:
push:
branches: [dev]
pull_request:
branches: [dev]
workflow_dispatch:
jobs:
typecheck:
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Bun
uses: ./.github/actions/setup-bun
- name: Run typecheck
run: bun typecheck
- name: Audit innerHTML usage
run: |
UNKNOWN=$(grep -rn "innerHTML" packages/web/src packages/app/src packages/ui/src \
--include="*.tsx" --include="*.ts" \
| grep -v "\.test\.ts:" \
| grep -v "content-bash.tsx" \
| grep -v "content-code.tsx" \
| grep -v "content-markdown.tsx" \
| grep -v "file-tree.tsx" \
| grep -v "prompt-input.tsx" \
| grep -v "settings-general.tsx" \
| grep -v "ui/src/components/markdown.tsx" \
| grep -v "ui/src/components/file-ssr.tsx" \
| grep -v "ui/src/components/icon.tsx" \
| grep -v "ui/src/components/file.tsx" \
| grep -v "ui/src/pierre/file-find.ts" \
|| true)
if [ -n "$UNKNOWN" ]; then
echo "::error::Unvetted innerHTML usage detected. Audit and add to .eslintrc.restrict.cjs before merging."
echo "$UNKNOWN"
exit 1
fi
- name: LOC gate (packages/app)
run: |
# Gate : aucun fichier TypeScript dans packages/app/src ne doit dépasser 1500 LOC
# Exceptions documentées : aucune (les fichiers > 1500 sont dans upstream packages)
GATE=1500
VIOLATIONS=$(find packages/app/src -name "*.ts" -o -name "*.tsx" | \
xargs wc -l 2>/dev/null | \
awk -v t=$GATE '$1 > t && $2 != "total" { print $1, $2 }' | \
grep -v "node_modules" || true)
if [ -n "$VIOLATIONS" ]; then
echo "❌ LOC gate FAILED — fichiers > ${GATE} LOC dans packages/app/src :"
echo "$VIOLATIONS"
exit 1
fi
echo "✅ LOC gate passed — aucun fichier packages/app/src > ${GATE} LOC"