fix(gradlew): collapse consecutive blank lines in build filter output#1940
Open
luinstra wants to merge 1 commit into
Open
fix(gradlew): collapse consecutive blank lines in build filter output#1940luinstra wants to merge 1 commit into
luinstra wants to merge 1 commit into
Conversation
`BuildLineFilter::feed_line` was a stateless predicate wrapper: any line for which `filter_build_line` returned true was emitted as-is. Because `filter_build_line` intentionally preserves blank lines as section separators between error blocks, real kotlin/JVM builds — which can emit hundreds of `w:` compiler warnings each separated by blank lines from Gradle's renderer — produced multi-screen runs of blanks between groups of warnings, overwhelming the actual signal. Make `BuildLineFilter` stateful with a `last_emitted_was_blank: bool` field. Single-blank separators are preserved; runs of 2+ blanks collapse to one. Non-blank lines are unaffected. Note: token savings from this patch are minimal — BPE tokenizers fully collapse runs of whitespace. The win is human-readable output (tee files, debug sessions), not API spend. Filed under fix anyway because it removes pathological output noise. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
|
LGTM as an outside reviewer 👍 The Maintainers: clean targeted change. Recommend merging. |
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
BuildLineFilter::feed_linewas stateless: every linefilter_build_lineaccepted got emitted as-is, including blanks intentionally kept as section separators.w:warnings separated by blank lines — this produced multi-screen runs of blank lines between groups of warnings, drowning the actual signal.BuildLineFilterstateful withlast_emitted_was_blank: bool. Single-blank separators are preserved; runs of 2+ collapse to one. Non-blank lines unaffected.Note on the "fix" framing: BPE tokenizers fully collapse whitespace runs, so this patch saves ~0 tokens. The win is human readability (tee files, debug sessions, scrollback). Filed as
fixbecause it removes pathological output noise that hides the actual build signal.Test plan
cargo fmt --all --check && cargo clippy --all-targets -- -D warnings && cargo test— all passassert_eq!via arun_build_filterhelper:test_build_filter_collapses_consecutive_blanks— runs of\n\n\n\ncollapse to\n\ntest_build_filter_preserves_single_blank_separator— single\n\nsurvivestest_build_filter_collapse_survives_dropped_lines_between_blanks—> Task :…stripped between blanks still collapses (regression for the "state only tracks emitted lines" decision)test_build_filter_leading_blanks_collapsed— initial run of blanks collapses to one