Skip to content

fix(coverage): isolate nested command spans - #1341

Merged
Chemaclass merged 1 commit into
mainfrom
fix/1338-nested-command-spans
Sep 7, 2026
Merged

fix(coverage): isolate nested command spans#1341
Chemaclass merged 1 commit into
mainfrom
fix/1338-nested-command-spans

Conversation

@Chemaclass

Copy link
Copy Markdown
Member

Background

Follow-up to #1339. A multiline array, quote, or continued command that contains a command or process substitution can lose coverage on its outer literal segments or mark skipped child commands as covered. Case arm delimiters and arithmetic syntax can also corrupt the scanner state and affect later statements.

Changes

  • Preserve parent literal and continuation spans across substitutions while excluding child-only command lines.
  • Track case header, pattern, and body phases, arithmetic contexts, heredocs, and continuation ancestry consistently in the Bash and awk scanners.
  • Add opening-hit, closing-hit, nested case, arithmetic, heredoc, and skipped-child regressions with terminal, LCOV, and HTML report coverage.

Validation

  • 60 focused tests and 123 assertions passed.
  • ShellCheck passed on all changed shell files.
  • Bash syntax checks passed, including the regression fixtures.
  • make lint and git diff --check passed.

Checklist

  • I updated the CHANGELOG.md to reflect the new feature or fix
  • I updated the documentation to reflect the changes

Refs #1338

Preserve outer literal and continued-command coverage across substitutions without crediting child commands. Track case phases and arithmetic contexts so delimiters cannot expose parent spans.

Keep Bash and awk report propagation aligned.

Refs #1338
@Chemaclass Chemaclass self-assigned this Sep 7, 2026
@Chemaclass Chemaclass added the bug Something isn't working label Sep 7, 2026
@Chemaclass
Chemaclass enabled auto-merge (squash) September 7, 2026 10:31
@Chemaclass
Chemaclass merged commit 532527a into main Sep 7, 2026
37 checks passed
@Chemaclass
Chemaclass deleted the fix/1338-nested-command-spans branch September 7, 2026 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants