Skip to content

Commit 6e72f54

Browse files
fix(prs): classify generated files and evals correctly (#26563)
1 parent ad3ea30 commit 6e72f54

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

‎packages/shared/src/changedFileKind.test.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ describe("classifyChangedFile", () => {
77
["src/contest.py", "code"],
88
["test/fixtures/pr.json", "mocks"],
99
["pnpm-lock.yaml", "generated"],
10+
["convex/_generated/api.d.ts", "generated"],
11+
["src/agent.eval.ts", "tests"],
12+
["evals/title-generation.ts", "tests"],
1013
["README.md", "docs"],
1114
["tests/README.md", "tests"],
1215
] as const)("%s is %s", (path, kind) => {

‎packages/shared/src/changedFileKind.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const GENERATED_FILES = new Set([
2626
]);
2727
const GENERATED_NAME =
2828
/(\.generated\.|\.gen\.|\.g\.dart$|\.pb\.go$|_pb2(_grpc)?\.py$|\.pb\.(cc|h)$|\.min\.(js|css)$|\.(js|css)\.map$)/;
29-
const GENERATED_DIRS = new Set(["__generated__", "generated"]);
29+
const GENERATED_DIRS = new Set(["__generated__", "_generated", "generated"]);
3030

3131
const MOCK_NAME =
3232
/(\.snap$|\.(mocks?|fixtures?|stubs?|fakes?)\.[^.]+$|^(mocks?|fixtures?|stubs?|fakes?)([-_.A-Z]|$))/;
@@ -44,14 +44,15 @@ const MOCK_DIRS = new Set([
4444
]);
4545

4646
const TEST_NAME =
47-
/(\.(test|spec|e2e)\.[^.]+$|_(test|spec)\.[^.]+$|^test_.+\.py$|^conftest\.py$|^(vitest|jest)\.setup\.[^.]+$)/i;
47+
/(\.(test|spec|e2e|eval)\.[^.]+$|_(test|spec)\.[^.]+$|^test_.+\.py$|^conftest\.py$|^(vitest|jest)\.setup\.[^.]+$)/i;
4848
// Case-sensitive: `FooTest.java` is a test class, `Latest.java` is not.
4949
const CLASS_TEST_NAME = /(Tests?|Spec)\.(java|kt|kts|scala|groovy|cs|php|swift|m)$/;
5050
const TEST_DIRS = new Set([
5151
"__tests__",
5252
"__test__",
5353
"cypress",
5454
"e2e",
55+
"evals",
5556
"spec",
5657
"specs",
5758
"test",

0 commit comments

Comments
 (0)