Skip to content

docs: annotate unreachable guards with c8 ignore for coverage consistency - #570

Merged
askpt merged 2 commits into
mainfrom
repo-assist/improve-doc-c8-ignore-guards-20260824-8bfae2de9b1da8da
Aug 28, 2026
Merged

docs: annotate unreachable guards with c8 ignore for coverage consistency#570
askpt merged 2 commits into
mainfrom
repo-assist/improve-doc-c8-ignore-guards-20260824-8bfae2de9b1da8da

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Summary

While investigating Tasks 4/8/9 (Engineering Investments, Performance, Testing) this run, an explore pass found no new engineering, performance, or coverage-gap work (all remaining uncovered lines are already documented /* c8 ignore */ defensive fallbacks, and CI actions/dependencies are already at latest or covered by open Dependabot PRs #501/#455/#546). Per the fallback table, this run substitutes Task 5 (Coding Improvements).

Change

Two defensive guards were unreachable-by-grammar but missing the /* c8 ignore */ annotation that equivalent guards elsewhere in the codebase already carry:

  • jsLikeAnalyzer.ts getOperator(): !operatorNode guard — sibling csharpAnalyzer.getBinaryOperator has the same guard with /* c8 ignore next */.
  • pythonAnalyzer.ts analyzeFunction(): !body guard — sibling pythonAnalyzer.getBooleanOperator has the same style of guard already annotated.

Adding the annotations is purely documentation/consistency and slightly raises measured branch coverage (94.67% to 95.0%; jsLikeAnalyzer.ts branch coverage 99.15% to 100%).

Trade-offs

No behavior change. No new dependency. Minimal, surgical, two-line diff.

Test Status

  • npm run compile: clean
  • npm run lint: clean
  • npm run test:coverage (unit tests + coverage): 227 passing, coverage 98.74/95.0/99.01/98.74 (up from 98.68/94.67/99.01/98.68)
  • npm run test:vscode (full vscode-test suite): blocked by sandbox network (getaddrinfo EAI_AGAIN update.code.visualstudio.com) - same known limitation as every prior repo-assist run in this sandbox, not caused by this change.

🤖 This PR was created by Repo Assist, an automated AI assistant, as part of its regular maintenance run.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • releaseassets.githubusercontent.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "releaseassets.githubusercontent.com"

See Network Configuration for more information.

Generated by 🌈 Repo Assist, see workflow run. Learn more.
Comment /repo-assist to run again

Add this agentic workflow to your repo

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@42c2ab5b4e4c9273534c39259b2e0df7f20f07e9

jsLikeAnalyzer.getOperator's !operatorNode guard and
pythonAnalyzer.analyzeFunction's !body guard were unreachable by
grammar (binary_expression/boolean_operator always have an operator
child at index 1; function_definition/lambda always have a body),
but unlike their sibling analyzers (csharpAnalyzer.getBinaryOperator,
pythonAnalyzer.getBooleanOperator) they lacked the /* c8 ignore */
annotation explaining this. Added it for consistency and to raise
branch coverage slightly (94.67% -> 95.0%).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@askpt askpt changed the title [repo-assist] docs: annotate unreachable guards with c8 ignore for coverage consistency docs: annotate unreachable guards with c8 ignore for coverage consistency Aug 27, 2026
@codecov

codecov Bot commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.02%. Comparing base (a40c854) to head (4de7734).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #570      +/-   ##
==========================================
+ Coverage   97.92%   98.02%   +0.10%     
==========================================
  Files          12       12              
  Lines        3899     3901       +2     
  Branches      450      450              
==========================================
+ Hits         3818     3824       +6     
+ Misses         81       77       -4     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@askpt
askpt marked this pull request as ready for review August 27, 2026 20:39
Copilot AI balanced review requested due to automatic review settings August 27, 2026 20:39
@askpt
askpt self-requested a review as a code owner August 27, 2026 20:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The annotations correctly target defensive fallback paths and introduce no behavioral changes.

Pull request overview

Adds c8 coverage-ignore annotations to grammar-unreachable defensive guards without changing runtime behavior.

Changes:

  • Annotates missing operator and Python function-body fallbacks.
  • Aligns coverage handling with equivalent analyzer guards.
File summaries
File Description
src/metricsAnalyzer/languages/jsLikeAnalyzer.ts Ignores the unreachable missing-operator guard.
src/metricsAnalyzer/languages/pythonAnalyzer.ts Ignores the unreachable missing-body guard.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@askpt
askpt merged commit b24f965 into main Aug 28, 2026
11 checks passed
@askpt
askpt deleted the repo-assist/improve-doc-c8-ignore-guards-20260824-8bfae2de9b1da8da branch August 28, 2026 06:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants