feat: add --min-coverage and --max-annotations flags#294
Merged
Conversation
--min-coverage (0–100): fails the command with a non-zero exit code if overall Apex line coverage is below the threshold. Reports are written before the check so the output is always available for inspection. --max-annotations (≥1, default 50): overrides the maximum number of ::warning annotations emitted by the github-actions format. Annotations beyond the cap are summarised in a ::notice line. Exposes the previously hardcoded DEFAULT_MAX_ANNOTATIONS constant as a named export so the command can reference the default in the flag definition. Internal: transformCoverageReport now returns lineRate alongside finalPaths and warnings. processDeployCoverage and processTestCoverage return line totals used to compute the overall rate. ReportRenderOptions threads maxAnnotations from the transformer through reportGenerator into generateGitHubActions. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
--min-coverage is intentionally optional with no default — omitting it disables the threshold check entirely. The rule does not apply here. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
--min-coverage(integer, 0–100, optional): Fails the command with a non-zero exit code if overall Apex line coverage is below the threshold. Reports are written before the check so the output is always available for debugging.--max-annotations(integer, ≥1, default 50): Overrides the maximum number of::warningannotations emitted by--format github-actions. Annotations beyond the cap are summarised in a::noticeline. Exposes the previously-hardcoded constant so CI teams can tune it.Internal changes:
transformCoverageReportnow returnslineRatealongsidefinalPathsandwarningsprocessDeployCoverageandprocessTestCoverageaccumulate line totals to compute the overall rateReportRenderOptionsthreadsmaxAnnotationsfrom the transformer throughreportGeneratorintogenerateGitHubActionsTest plan
npm run test:only) — 100% branch coverage (205/205)minCoverage: 0resolves without errorminCoverage: 100throws with message matching/below the required minimum of 100%/maxAnnotations: 2override viagenerateAndWriteReportoptions caps warnings at 2 with truncation noticemaxAnnotations: 1passed throughtransformCoverageReportto the generator🤖 Generated with Claude Code