-
Notifications
You must be signed in to change notification settings - Fork 169
123 lines (105 loc) · 3.08 KB
/
Copy pathlint.yml
File metadata and controls
123 lines (105 loc) · 3.08 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
118
119
120
121
122
123
name: Lint
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
inputs:
force_full_run:
description: 'Force a full lint run'
type: boolean
default: false
jobs:
changes:
runs-on: ubuntu-latest
outputs:
backend: ${{ steps.filter.outputs.backend }}
client: ${{ steps.filter.outputs.client }}
force_full_run: ${{ github.event.inputs.force_full_run || 'false' }}
steps:
- uses: actions/checkout@v7
- uses: dorny/paths-filter@v4
id: filter
with:
filters: |
backend:
- 'backend/**'
- 'shared/**'
client:
- 'client/**'
- 'shared/**'
lint-root:
name: Lint Root Directory
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Verify no implementation artifacts in root
run: |
ALLOWED="README.md CONTRIBUTING.md AGENTS.md CLAUDE.md requirements.txt"
for file in *.md *.txt; do
if [ -f "$file" ]; then
if ! echo "$ALLOWED" | grep -w -q "$file"; then
echo "❌ Error: $file found in root. Move long-form implementation artifacts to docs/archive/."
exit 1
fi
fi
done
echo "✅ Root directory is clean"
lint-backend:
name: Lint Backend
runs-on: ubuntu-latest
needs: changes
if: ${{ needs.changes.outputs.force_full_run == 'true' || needs.changes.outputs.backend == 'true' }}
defaults:
run:
working-directory: backend
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: "20"
cache: "npm"
cache-dependency-path: backend/package-lock.json
- name: Install dependencies
run: npm install
- name: Run ESLint
run: npx eslint src --ext .ts --max-warnings 0
lint-client:
name: Lint Client
runs-on: ubuntu-latest
needs: changes
if: ${{ needs.changes.outputs.force_full_run == 'true' || needs.changes.outputs.client == 'true' }}
defaults:
run:
working-directory: client
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: "20"
cache: "npm"
cache-dependency-path: client/package-lock.json
- name: Install dependencies
run: npm ci
- name: Run Next.js linter (includes package boundary rules)
run: npx next lint
lint-sdk:
name: Lint SDK
runs-on: ubuntu-latest
needs: changes
if: ${{ needs.changes.outputs.force_full_run == 'true' }}
defaults:
run:
working-directory: sdk
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: "20"
cache: "npm"
cache-dependency-path: sdk/package-lock.json
- name: Install dependencies
run: npm install
- name: Run ESLint (boundary check included)
run: npx eslint "src/**/*.ts" --max-warnings 0