Skip to content

diff-filter: add Protocol Buffers Python/Ruby generated file suffixes (_pb2.py, _pb2.pyi, _pb2_grpc.py, _pb.rb) #154

Description

@aagear

Problem

packages/diff-filter's GENERATED_FILE_SUFFIXES covers Protocol Buffers generated files for Go (.pb.go), TypeScript (.pb.ts, _pb.d.ts), JavaScript (.pb.js, _pb.js), and Dart (.g.dart), but is missing Python and Ruby — two of the most popular gRPC languages.

Missing generated file suffixes

Suffix Language Tool Notes
_pb2.py Python protoc Generated message classes — one per .proto file
_pb2.pyi Python protoc Type stubs for _pb2.py (generated with --pyi_out)
_pb2_grpc.py Python protoc (grpc plugin) Generated gRPC client/server stubs
_pb.rb Ruby protoc Generated Ruby message classes

These files are auto-generated by protoc / grpc_tools.protoc and routinely committed by mistake, producing hundreds of lines of diff noise in PRs.

Expected

classifyPath() should return { ignore: true, reason: "generated_suffix" } for paths ending in these suffixes, just as it does for .pb.go and _pb.js.

Current behaviour

None of these suffixes exist in packages/diff-filter/src/patterns.ts.

Size

Small — add 4 entries to the GENERATED_FILE_SUFFIXES array + corresponding test cases in classify.test.ts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions