Skip to content

feat: add default ignore patterns for protobuf-generated files#1111

Merged
svarlamov merged 1 commit intomainfrom
devin/1776212703-ignore-protobuf-generated
Apr 15, 2026
Merged

feat: add default ignore patterns for protobuf-generated files#1111
svarlamov merged 1 commit intomainfrom
devin/1776212703-ignore-protobuf-generated

Conversation

@svarlamov
Copy link
Copy Markdown
Member

@svarlamov svarlamov commented Apr 15, 2026

Summary

Adds 9 protobuf-generated file patterns to DEFAULT_IGNORE_PATTERNS in src/authorship/ignore.rs so that protoc output is excluded from git-ai tracking by default. Previously, these files were counted as human-authored code, inflating human line counts and diluting AI acceptance rates.

New patterns: *.pbobjc.h, *.pbobjc.m, *.pb.go, *.pb.h, *.pb.cc, *_pb2.py, *_pb2_grpc.py, *.pb.swift, *.pb.dart.

Java/Kotlin protobuf outputs are intentionally excluded—they generate ordinary .java/.kt filenames with no distinguishing suffix. Users can handle those via .gitattributes linguist-generated or .git-ai-ignore, which are already supported.

Closes #1103

Review & Testing Checklist for Human

  • Behavior change: this silently changes defaults for existing users who have protobuf files in their repos. Confirm this is the desired default (users can still override via .git-ai-ignore or config).
  • False-positive risk on *.pb.h / *.pb.cc: verify there are no common non-protobuf naming conventions that use .pb. as a double extension in C++ headers/sources.
  • Spot-check that the glob patterns work correctly for both bare filenames and nested paths (unit tests cover this, but worth a manual sanity check on edge cases).

Notes

  • Developed TDD-style: tests were written first and confirmed failing, then the patterns were added.
  • The integration test covers all 9 patterns across realistic nested directory structures and is also reused in the worktree variant via reuse_tests_in_worktree!.

Link to Devin session: https://app.devin.ai/sessions/f4b349e42ecd4f5081c5876e28a5093f
Requested by: @svarlamov


Open with Devin

Add *.pbobjc.h, *.pbobjc.m, *.pb.go, *.pb.h, *.pb.cc, *_pb2.py,
*_pb2_grpc.py, *.pb.swift, and *.pb.dart to DEFAULT_IGNORE_PATTERNS
so protobuf-generated code is excluded from tracking by default.

Closes #1103

Co-Authored-By: Sasha Varlamov <sasha@sashavarlamov.com>
@devin-ai-integration
Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

@svarlamov svarlamov merged commit 2157784 into main Apr 15, 2026
19 of 26 checks passed
@svarlamov svarlamov deleted the devin/1776212703-ignore-protobuf-generated branch April 15, 2026 01:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: add default ignore patterns for protobuf-generated files (*.pbobjc.h, *.pbobjc.m, *.pb.go, etc.)

2 participants