Skip to content

Commit 2b7fa00

Browse files
fix: Address CodeRabbit review comments
- Configure Biome to enforce noExplicitAny: "error" - Fix vi.mock path to include .js extension - Add proper type signatures to all Mock types - Fix AGENTS.md test fixture documentation - Convert bare URLs to markdown links Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent f76397e commit 2b7fa00

4 files changed

Lines changed: 25 additions & 31 deletions

File tree

AGENTS.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ The action is tested end-to-end on every PR using `test-prompts/`:
9696
5. Verifies action can execute, parse configs, and post results
9797

9898
**Test Files:**
99-
- `test-prompts/promptfooconfig.yaml` - Minimal config (gpt-4o-mini, 1 test)
99+
- `test-prompts/promptfooconfig.yaml` - Minimal config (echo provider, 1 test)
100100
- `test-prompts/test-prompt.txt` - Simple prompt with variable
101101
- `test-prompts/README.md` - Documentation
102102

@@ -478,10 +478,10 @@ git add lib/
478478
479479
## Additional Resources
480480
481-
- **Promptfoo Documentation:** https://www.promptfoo.dev/docs/
482-
- **GitHub Actions Toolkit:** https://github.com/actions/toolkit
483-
- **Vitest Documentation:** https://vitest.dev/
484-
- **Biome Documentation:** https://biomejs.dev/
481+
- [Promptfoo Documentation](https://www.promptfoo.dev/docs/)
482+
- [GitHub Actions Toolkit](https://github.com/actions/toolkit)
483+
- [Vitest Documentation](https://vitest.dev/)
484+
- [Biome Documentation](https://biomejs.dev/)
485485
486486
## Debugging Tips
487487

__tests__/main.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const actualFs = await vi.importActual<typeof import('fs')>('fs');
2222
type MockOctokit = {
2323
rest: {
2424
issues: {
25-
createComment: Mock;
25+
createComment: Mock<() => Promise<unknown>>;
2626
};
2727
};
2828
};
@@ -53,7 +53,7 @@ vi.mock('simple-git', () => ({
5353
}));
5454

5555
// Mock auth utilities
56-
vi.mock('../src/utils/auth');
56+
vi.mock('../src/utils/auth.js');
5757

5858
import { handleError, run } from '../src/main.js';
5959
import * as auth from '../src/utils/auth.js';

__tests__/utils/cache.test.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,18 @@ vi.mock('fs', async () => {
4848
};
4949
});
5050

51-
const mockCore = core as { info: Mock; debug: Mock };
51+
const mockCore = core as {
52+
info: Mock<(message: string) => void>;
53+
debug: Mock<(message: string) => void>;
54+
};
5255
const mockFs = fs as unknown as {
53-
existsSync: Mock;
54-
mkdirSync: Mock;
55-
readdirSync: Mock;
56-
statSync: Mock;
57-
unlinkSync: Mock;
58-
rmdirSync: Mock;
59-
writeFileSync: Mock;
56+
existsSync: Mock<(path: string) => boolean>;
57+
mkdirSync: Mock<(path: string, options?: unknown) => void>;
58+
readdirSync: Mock<(path: string) => string[]>;
59+
statSync: Mock<(path: string) => { mtime: Date; size: number }>;
60+
unlinkSync: Mock<(path: string) => void>;
61+
rmdirSync: Mock<(path: string) => void>;
62+
writeFileSync: Mock<(path: string, data: string) => void>;
6063
};
6164

6265
describe('Cache Utilities', () => {

biome.json

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/2.3.13/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/2.3.12/schema.json",
33
"files": {
44
"maxSize": 2097152,
55
"ignoreUnknown": true,
@@ -9,17 +9,13 @@
99
"__tests__/**/*.ts",
1010
"*.js",
1111
"*.ts"
12-
],
13-
"experimentalScannerIgnores": [
14-
"node_modules",
15-
"dist/**",
16-
"build",
17-
"coverage",
18-
"lib/**",
19-
".next",
20-
"*.min.js"
2112
]
2213
},
14+
"vcs": {
15+
"enabled": true,
16+
"clientKind": "git",
17+
"useIgnoreFile": true
18+
},
2319
"linter": {
2420
"enabled": true,
2521
"rules": {
@@ -39,7 +35,7 @@
3935
"useNodejsImportProtocol": "off"
4036
},
4137
"suspicious": {
42-
"noExplicitAny": "off"
38+
"noExplicitAny": "error"
4339
}
4440
}
4541
},
@@ -59,10 +55,5 @@
5955
"jsxQuoteStyle": "double",
6056
"arrowParentheses": "always"
6157
}
62-
},
63-
"vcs": {
64-
"enabled": true,
65-
"clientKind": "git",
66-
"useIgnoreFile": true
6758
}
6859
}

0 commit comments

Comments
 (0)