Skip to content

Commit 69f7a8c

Browse files
committed
Add lint/format toolchain and split CI into concurrent jobs
1 parent 2b523c2 commit 69f7a8c

9 files changed

Lines changed: 339 additions & 16 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 69 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,70 @@ on:
66
pull_request:
77
workflow_dispatch:
88

9+
concurrency:
10+
group: ci-${{ github.workflow }}-${{ github.event_name == 'push' && github.sha || github.ref }}
11+
cancel-in-progress: ${{ github.event_name != 'push' }}
12+
913
jobs:
10-
check:
14+
lint:
15+
runs-on: ubuntu-latest
16+
# TODO(CL-6802 stage 2): flip blocking after the mechanical fix batch
17+
continue-on-error: true
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Setup Bun
23+
uses: oven-sh/setup-bun@v2
24+
with:
25+
bun-version: "1.3.14"
26+
27+
- name: Cache dependencies
28+
uses: actions/cache@v4
29+
with:
30+
path: node_modules
31+
key: bun-${{ hashFiles('bun.lock') }}
32+
33+
- name: Install dependencies
34+
run: bun install --frozen-lockfile
35+
36+
- name: Cache lint
37+
uses: actions/cache@v4
38+
with:
39+
path: |
40+
.eslintcache
41+
node_modules/.cache/prettier
42+
key: lint-${{ github.sha }}
43+
restore-keys: |
44+
lint-
45+
46+
- name: Lint
47+
run: bun run lint
48+
49+
typecheck:
50+
runs-on: ubuntu-latest
51+
steps:
52+
- name: Checkout
53+
uses: actions/checkout@v4
54+
55+
- name: Setup Bun
56+
uses: oven-sh/setup-bun@v2
57+
with:
58+
bun-version: "1.3.14"
59+
60+
- name: Cache dependencies
61+
uses: actions/cache@v4
62+
with:
63+
path: node_modules
64+
key: bun-${{ hashFiles('bun.lock') }}
65+
66+
- name: Install dependencies
67+
run: bun install --frozen-lockfile
68+
69+
- name: Typecheck
70+
run: bun run typecheck
71+
72+
build-and-test:
1173
runs-on: ubuntu-latest
1274
steps:
1375
- name: Checkout
@@ -23,6 +85,12 @@ jobs:
2385
with:
2486
bun-version: "1.3.14"
2587

88+
- name: Cache dependencies
89+
uses: actions/cache@v4
90+
with:
91+
path: node_modules
92+
key: bun-${{ hashFiles('bun.lock') }}
93+
2694
# The runner image has no ripgrep, so the grep plugin silently exercised
2795
# its fallback walker and left the ripgrep path untested.
2896
- name: Install ripgrep
@@ -31,9 +99,6 @@ jobs:
3199
- name: Install dependencies
32100
run: bun install --frozen-lockfile
33101

34-
- name: Typecheck
35-
run: bun run typecheck
36-
37102
- name: Build
38103
run: bun run build
39104

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ dist/
88
.corbits/MEMORY.md
99
.interchange/
1010
.cache/
11+
.eslintcache
1112
.pi
1213
.claude/settings.local.json
1314
.claude/worktrees

‎.prettierignore‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
dist/
2+
vendor/
3+
.worktrees/
4+
scratch/
5+
node_modules/
6+
CHANGELOG.md

‎.prettierrc.json‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"semi": true,
3+
"trailingComma": "all",
4+
"printWidth": 100
5+
}

‎AGENTS.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ When refactoring replaces an old path, delete the old one. No back-compat shims,
3838
## Build & Validation
3939

4040
```bash
41-
bun run typecheck
42-
bun run build
43-
bun run test
41+
bun run check
4442
```
4543

44+
`bun run check` is the single pre-PR gate: it runs `lint`, `typecheck`, `build`, and `test`, in that order, matching CI.
45+
4646
Run the full suite before declaring any task complete. Do not substitute individual targets. If a failure is pre-existing and unrelated to your change, say so explicitly.
4747

4848
`bun run test` runs `bun test ./src ./tests ./evals`. A bare `bun test` also

‎bun.lock‎

Lines changed: 209 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎eslint.config.js‎

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import js from "@eslint/js";
2+
import tseslint from "typescript-eslint";
3+
4+
export default tseslint.config(
5+
{
6+
ignores: [
7+
"dist/**",
8+
"vendor/**",
9+
".worktrees/**",
10+
"**/.worktrees/**",
11+
".scratch/**",
12+
"**/.scratch/**",
13+
"scratch/**",
14+
"**/scratch/**",
15+
"node_modules/**",
16+
"**/node_modules/**",
17+
],
18+
},
19+
js.configs.recommended,
20+
...tseslint.configs.strict,
21+
...tseslint.configs.stylistic,
22+
{
23+
linterOptions: {
24+
noInlineConfig: true,
25+
reportUnusedDisableDirectives: "error",
26+
},
27+
rules: {
28+
"@typescript-eslint/no-unused-vars": [
29+
"error",
30+
{
31+
args: "all",
32+
argsIgnorePattern: "^_",
33+
varsIgnorePattern: "^_",
34+
caughtErrorsIgnorePattern: "^_",
35+
},
36+
],
37+
},
38+
},
39+
);

‎package.json‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
"build:bin": "bun build ./src/index.ts --compile --minify --define process.env.NODE_ENV='\"production\"' --outfile ./dist/corbits && bun scripts/copy-repo-plugins.ts",
3434
"typecheck": "tsc --noEmit",
3535
"test": "bun test ./src ./tests ./evals",
36+
"lint": "prettier --check --cache . && eslint --cache .",
37+
"check": "bun run lint && bun run typecheck && bun run build && bun run test",
3638
"start": "bun run build && bun ./dist/index.js",
3739
"eval:capability": "bun scripts/eval-capability.ts",
3840
"eval:public-swe-one": "bun scripts/eval-public-swe-one.ts",
@@ -79,9 +81,13 @@
7981
"solid-js": "1.9.14"
8082
},
8183
"devDependencies": {
84+
"@eslint/js": "^9.39.0",
8285
"@intx/inference-testing": "0.2.2",
8386
"@types/bun": "1.3.9",
87+
"eslint": "^9.39.0",
88+
"prettier": "^3.6.2",
8489
"typescript": "5.9.3",
90+
"typescript-eslint": "^8.46.4",
8591
"typescript-language-server": "^4.3.4",
8692
"ws": "^8.21.0"
8793
},

‎tsconfig.base.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"declarationMap": true,
2020

2121
"composite": true,
22+
"incremental": true,
2223
"module": "ESNext",
2324
"noEmit": true,
2425

0 commit comments

Comments
 (0)