Add combined, per-root, and comparison summary scopes - #832
Merged
Merged
Conversation
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.
Add
--summary-scopeto combine statistics across roots, report each root separately, or summarize comparison categories. Existing summary groupings can now accompany comparison counts without losing left/right size information.AG;DR
all(default),root,left-only,right-only,different, andidenticalscopes.left/rightalias the one-sided categories;diffandcompareexpand to ordered category lists. Expansion removes duplicates, and repeating the flag replaces the list.--compare-select. Paired categories emit separate tables for the two roots. Combined comparison statistics count both copies, including identical content.--summary=compareas comparison counts and percentages. Bare--summaryin comparison mode additionally requests ordinary counts/sizes when a scope is explicit. Scope without an active file-summary driver is a usage error, including--compare=summary --summary-scope=alland scopes following--summary=none. The shortcut expands to--summary=compare; users add--summaryor a grouping for file statistics. Validation precedes traversal and actions.Validation: all seven affected Bazel targets passed (
summary_test,globals_test,help_render_test,help_topic_test,run_test,xff_markdown_test,xff_notice_test). Tests include three roots, unequal pair sizes, category aliases/deduplication, combined counts, empty roots, replacement semantics, templates/collections, and invalid contexts. Normal pre-commit checks include changed-file clang-tidy, clang-format, shfmt, and shellcheck. macOS validation used the existing local Apple linker workaround; CI validates the supported platform matrix.Category statistics require retained per-entry reduction data in addition to the comparison entries. Entries excluded from comparison classification do not enter category tables, even where special feeds include them in whole-root statistics.
--summary-scopedoes not change histogram populations.Follow-up validation: summary CLI and engine tests pass with regressions for both reported shortcut/scope combinations, explicit comparison-only summaries, clearing/restoring summaries, and rejection before execution. Regenerated Markdown passes its diff test; changed-file clang-tidy and formatting checks pass. Main now includes #831; its changelog-only conflict is resolved while retaining the feature notes.
Coverage follow-up: add direct engine and end-to-end cases for plain scope labels, count/name tie-breaking under
--top, and empty comparison scope rejection. These exercise the 14 changed lines reported uncovered by CI. Both test targets pass locally; local coverage collection produced no usable line counters, so the measured patch percentage is verified by the Linux CI coverage job. No production behavior or thresholds changed in this follow-up.CI coverage verification on
8aa6addaf: patch lines 275/275 (100.00%), branches 174/180 (96.67%), rating GOOD. The coverage gate passed.