diff --git a/src/signals/path-matchers.ts b/src/signals/path-matchers.ts index 7629e6745f..e03567221e 100644 --- a/src/signals/path-matchers.ts +++ b/src/signals/path-matchers.ts @@ -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) || diff --git a/test/unit/path-matchers.test.ts b/test/unit/path-matchers.test.ts index bc149b2291..cac5f2dd79 100644 --- a/test/unit/path-matchers.test.ts +++ b/test/unit/path-matchers.test.ts @@ -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", @@ -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); } });