From 441215ddb64d8addbd10c254afbca3b5b5c6bf8a Mon Sep 17 00:00:00 2001 From: jimcody1995 Date: Sun, 5 Jul 2026 08:31:57 +0200 Subject: [PATCH] fix(signals): classify Dart protobuf stubs as generated protoc's Dart plugin emits .pb.dart message stubs; slop already treated .pb.go/.pb.swift as generated but missed .pb.dart, so machine output was miscounted as substantive source. Co-authored-by: Cursor --- src/signals/path-matchers.ts | 6 +++--- test/unit/path-matchers.test.ts | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/signals/path-matchers.ts b/src/signals/path-matchers.ts index aa5467ef8a..7629e6745f 100644 --- a/src/signals/path-matchers.ts +++ b/src/signals/path-matchers.ts @@ -51,9 +51,9 @@ 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`, and the Swift plugin emits `.pb.swift` (the `.pb` infix keeps a - // hand-written `.h`/`.cc`/`.swift` from matching). - /\.pb\.(go|ts|js|cc|h|swift)$/.test(norm) || + // `.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) || // 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 750185e4ae..bc149b2291 100644 --- a/test/unit/path-matchers.test.ts +++ b/test/unit/path-matchers.test.ts @@ -76,6 +76,7 @@ describe("isGeneratedFile", () => { it("matches Swift protobuf, Dart freezed/retrofit, and C# designer/XAML codegen", () => { for (const path of [ "proto/messages.pb.swift", + "proto/messages.pb.dart", "lib/user.freezed.dart", "lib/api_client.gr.dart", "ui/MainForm.Designer.cs",