Versatility: configurable grouping, failure policy, GitHub Actions & programmatic API - #2
Merged
Conversation
…grammatic API
Generic project support (A):
- Default include now covers resources/views AND packages/*/resources/views, so
the plugin is useful zero-config on a standard app or a monorepo.
- New 'group_by' option (auto|package|directory|flat) via BladeViewGrouper;
output grouping is no longer hardcoded to the packages/<name> layout.
Flexible failure policy (C):
- Inline '{{-- blade-coverage:ignore --}}' marker drops a view from targets.
- 'mode' => 'strict' ignores the baseline and fails on any uncovered view.
- 'min_coverage' => N fails when covered percentage falls below the threshold.
Richer CI integration (B):
- GithubActionsReporter auto-emits ::error annotations for new/changed uncovered
views and appends a summary table to $GITHUB_STEP_SUMMARY when in Actions.
Programmatic use (D):
- BladeCoverage::capture()/rendered() capture views rendered by a callback for
single-test assertions, independent of the suite-wide run.
Reporting:
- Console summary and JSON report now include coverage percentage (JSON keeps the
float via JSON_PRESERVE_ZERO_FRACTION); JSON 'failed' reflects the effective
policy outcome.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
…ter and programmatic API Co-Authored-By: Claude Opus 4.8 <[email protected]>
…d programmatic API Co-Authored-By: Claude Opus 4.8 <[email protected]>
howdu
merged commit Jun 2, 2026
ca2dd1b
into
fix/config-defaults-and-drift-detection
5 checks passed
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
Follow-up to #1 that makes the plugin useful beyond the package-heavy-monorepo shape it was built for. Implements all four agreed directions. Stacked on #1 — base it on
mainonce #1 merges, or merge #1 first.A — Generic project support
resources/views/**/*.blade.phpandpackages/*/resources/views/**/*.blade.php, so a standard app works without a config file.group_by:auto(default — package name forpackages/<name>/…, else containing directory),package,directory,flat. The hardcodedpackages/<name>grouping (everything else fell into "other") is gone, extracted intoBladeViewGrouper.B — Richer CI integration
::error file=…,line=1inline annotations for each new/changed uncovered view (they show on the PR diff), plus a coverage summary table appended to$GITHUB_STEP_SUMMARY. No flags; no-op elsewhere.C — Flexible failure policy
{{-- blade-coverage:ignore --}}drops a view from targets — co-located, survives renames better thanexcludeglobs.'mode' => 'strict') ignores the baseline and fails on any uncovered view.'min_coverage' => N) fails below a threshold; combines with either mode.D — Programmatic / standalone use
BladeCoverage::capture(callable)returns the view paths a callback rendered;BladeCoverage::rendered($view, callable)for a boolean assertion — both self-contained, no plugin run required.Reporting niceties
JSON_PRESERVE_ZERO_FRACTION); JSONfailednow reflects the effective policy outcome (e.g. a min-coverage breach), not just baseline state.Backwards compatibility
All new config keys are optional with safe fallbacks (invalid
group_by/mode→ defaults; out-of-rangemin_coverageclamped to 0–100). Existing baseline behaviour is unchanged when none of the new keys are set. Note: the broadened default include only affects projects running with noincludeconfigured.Testing
vendor/bin/pest— 25 passed (was 19; +6 covering grouping, config parsing, ignore marker, coverage %/JSONfailedthreading, GH Actions annotations+summary, and the programmatic helper).vendor/bin/pint --testpasses; verified under bothprefer-lowestandprefer-stable.🤖 Generated with Claude Code