Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/signals/path-matchers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ function isGeneratedFileFrom(parts: NormalizedPath): boolean {
/\.(generated|gen)\.[^/]+$/.test(norm) ||
// protoc output: Go/TS/JS plugins emit `.pb.{go,ts,js}`, the reference C++ plugin emits
// `.pb.cc` / `.pb.h`, the Swift plugin emits `.pb.swift`, and the Dart plugin emits
// `.pb.dart` (the `.pb` infix keeps hand-written `.dart` from matching).
/\.pb\.(go|ts|js|cc|h|swift|dart)$/.test(norm) ||
// `.pb.dart` (the `.pb` infix keeps hand-written `.dart`/`.kt` from matching).
/\.pb\.(go|ts|js|cc|h|swift|dart|kt)$/.test(norm) ||
// Python protobuf: message stubs are `*_pb2.py[i]`; the gRPC plugin emits sibling
// `*_pb2_grpc.py[i]` service stubs, which are the same machine-generated output.
/_pb2(_grpc)?\.pyi?$/.test(norm) ||
Expand Down
3 changes: 2 additions & 1 deletion test/unit/path-matchers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ describe("isGeneratedFile", () => {
for (const path of [
"proto/messages.pb.swift",
"proto/messages.pb.dart",
"proto/messages.pb.kt",
"lib/user.freezed.dart",
"lib/api_client.gr.dart",
"ui/MainForm.Designer.cs",
Expand All @@ -85,7 +86,7 @@ describe("isGeneratedFile", () => {
expect(isGeneratedFile(path)).toBe(true);
}
// hand-written siblings must NOT match (the codegen infix is required).
for (const path of ["src/MainForm.cs", "lib/user.dart", "net/message.swift"]) {
for (const path of ["src/MainForm.cs", "lib/user.dart", "src/service.kt", "net/message.swift"]) {
expect(isGeneratedFile(path)).toBe(false);
}
});
Expand Down
Loading