Uh oh!
There was an error while loading. Please reload this page.
fix(coverage): count only the braces that are code when spanning a function - #1087
Merged
Conversation
…nction A function ended where its braces balanced, counted with no regard for quoting. One stray brace in a comment, a string or a heredoc kept it open and it swallowed every later declaration: src/coverage/lines.sh reported 1 function instead of 11, and the END block of an embedded awk program was reported as a function called END. The scanner now carries quote and heredoc state across lines, because both span them, and a declaration is only recognised on a line that starts outside either. Bash itself is the oracle: under extdebug, declare -F gives the real start line of all 697 functions in src/, and extraction now matches every one of them, with nothing spurious. It was 19 missing and 2 spurious. FN, FNDA, FNF and FNH change; LF and BRF are byte-identical. Closes#1086
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Aug 13, 2026
Closed
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 freeto 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.
🤔 Background
Related #1086
A function ended where its braces balanced, counted with no regard for quoting.
One stray brace in a comment, a string or a heredoc kept it open, and it
swallowed every later declaration in the file —
src/coverage/lines.shreported 1 function instead of 11.
💡 Changes
extdebug,declare -Fgives the real start line of all 697 functions insrc/, and extraction now matches every one — it was 19 missing and 2 spurious (END {of an embedded awk program read as a function)FN,FNDA,FNFandFNHchange (680 → 697 records here);LFandBRFare byte-identical