feat(core): broaden .understandignore starter — C++ test/benchmark patterns#480
Open
thejesh23 wants to merge 1 commit into
Open
feat(core): broaden .understandignore starter — C++ test/benchmark patterns#480thejesh23 wants to merge 1 commit into
thejesh23 wants to merge 1 commit into
Conversation
…tterns Add four directory names (unittest, bench, benchmark, benchmarks) and a new C++ test-file pattern group covering gtest snake_case (*_test.cc), folly/LLVM PascalCase (*Test.cpp), Chromium *_unittest.cc / *_browsertest.cc, and co-located benchmarks (*_benchmark.cc, *Benchmark.cpp). The interleaved-tests case (abseil, Chromium, protobuf) needs file-pattern exclusions, not just dir rules — measured ~16-46% additional token reduction on those repos vs. directory-only ignores. Median ~35% across 6 surveyed projects (abseil, protobuf, grpc, nlohmann/json, bitcoin, folly). All suggestions stay commented-out — same opt-in model as f5682bf. SKILL.md needs no update; Phase 0.5 already delegates to generate-ignore.mjs (a0155c5). Refs Egonex-AI#479 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
EXACT_DIR_NAMES+=unittest,bench,benchmark,benchmarksTEST_PATTERN_GROUPSentryC++with 10 patterns (gtest snake_case, folly/LLVM PascalCase, Chromium_unittest/_browsertest, co-located benchmarks)ignore-generator.test.ts; build + lint clean (758/758)SKILL.mdunchanged — Phase 0.5 delegates togenerate-ignore.mjssince a0155c5, so no inline duplicate to keep in sync.Why these patterns (and not others)
Surveyed 18 major public C++ projects (LLVM, abseil, folly, protobuf, grpc, Chromium, bitcoin, mongo, godot, opencv, nlohmann/json, Catch2, doctest, …). Rejected as too project-specific:
unit-*.cpp(nlohmann-only),perf/(OpenCV-only, name too generic),*_perftest.cc(Chromium-only),gtest/(collides with vendored-framework path). The interleaved-tests case (abseil, Chromium, protobuf) is the load-bearing argument for file-pattern lines over dir-only rules.Token impact (measured on 7 public C++ projects)
Methodology:
gh api .../git/trees?recursive=1, C/C++ source =.cc .cpp .cxx .c .h .hpp, 1 MiB ≈ 262K tokens.abseil/abseil-cppprotocolbuffers/protobufgrpc/grpcnlohmann/jsonbitcoin/bitcoinfacebook/follytensorflow/tensorflowPer-project median ~31% reduction (range 16–62%); volume-weighted across the sample ~31%. Largest absolute saving on tensorflow (−14.1M tokens) due to pervasive
*_test.cccompanions throughout its source tree.Test plan
pnpm --filter @understand-anything/core build— cleanpnpm --filter @understand-anything/core test— 758/758 pass (38 inignore-generator.test.ts)pnpm lint— clean.understandignoreon a fixture withtests/,benchmarks/,unittest/,bench/dirs — output as expectedRefs #479
🤖 Generated with Claude Code