From 3a84b80876a6a42296e3ee4c7368d8c1a523a297 Mon Sep 17 00:00:00 2001 From: jimcody1995 Date: Sun, 5 Jul 2026 09:05:25 +0200 Subject: [PATCH] fix(signals): classify C# protobuf stubs as generated protoc's C# plugin emits .pb.cs message stubs; slop already treated .pb.kt/.pb.dart as generated but missed .pb.cs, so machine output was miscounted as substantive source. Co-authored-by: Cursor --- src/signals/path-matchers.ts | 7 ++++--- test/unit/path-matchers.test.ts | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/signals/path-matchers.ts b/src/signals/path-matchers.ts index e03567221e..3f5a2e69f8 100644 --- a/src/signals/path-matchers.ts +++ b/src/signals/path-matchers.ts @@ -51,9 +51,10 @@ function isGeneratedFileFrom(parts: NormalizedPath): boolean { /(^|\/)(__generated__|generated)\//.test(norm) || /\.(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`/`.kt` from matching). - /\.pb\.(go|ts|js|cc|h|swift|dart|kt)$/.test(norm) || + // `.pb.cc` / `.pb.h`, the Swift plugin emits `.pb.swift`, the Dart plugin emits `.pb.dart`, + // the Kotlin plugin emits `.pb.kt`, and the C# plugin emits `.pb.cs`. + // `.pb.dart`/`.pb.kt`/`.pb.cs` (the `.pb` infix keeps hand-written sources from matching). + /\.pb\.(go|ts|js|cc|h|swift|dart|kt|cs)$/.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 cac5f2dd79..f363acd404 100644 --- a/test/unit/path-matchers.test.ts +++ b/test/unit/path-matchers.test.ts @@ -78,6 +78,7 @@ describe("isGeneratedFile", () => { "proto/messages.pb.swift", "proto/messages.pb.dart", "proto/messages.pb.kt", + "proto/messages.pb.cs", "lib/user.freezed.dart", "lib/api_client.gr.dart", "ui/MainForm.Designer.cs",