Versatility: standard-app defaults, configurable grouping, failure policy, GitHub Actions & programmatic API - #3
Merged
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]>
Reorient the zero-config default to a standard Laravel app: DEFAULT_INCLUDE is now just resources/views/**/*.blade.php. The package-per-directory monorepo layout becomes an opt-in extra documented under a Monorepos section, rather than part of the default include. README intro and examples lead with the standard app shape. Co-Authored-By: Claude Opus 4.8 <[email protected]>
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
Makes the plugin useful beyond the package-heavy-monorepo shape it was built for, defaulting to a standard Laravel app first. (Re-opened against
main; the previous PR landed on the already-merged #1 branch instead ofmain.)Standard-app-first defaults
DEFAULT_INCLUDEis justresources/views/**/*.blade.php, so it works out of the box on a normal Laravel app.include), documented under a Monorepos section.Configurable output grouping
group_by:auto(default — package name forpackages/<name>/…, else containing directory),package,directory,flat. Extracted intoBladeViewGrouper; the hardcodedpackages/<name>grouping is gone.Flexible failure policy
{{-- blade-coverage:ignore --}}marker drops a view from targets (co-located, survives renames better thanexcludeglobs).mode: strictignores the baseline and fails on any uncovered view.min_coverage: Nfails when the covered percentage drops below the threshold; combines with either mode.Richer CI integration
::errorannotations for new/changed uncovered views (shown on the PR diff) + a coverage summary table appended to$GITHUB_STEP_SUMMARY. No flags; no-op elsewhere.Programmatic use
BladeCoverage::capture(callable)returns the view paths a callback rendered;BladeCoverage::rendered($view, callable)for a boolean assertion — self-contained, no plugin run required.Reporting
JSON_PRESERVE_ZERO_FRACTION); JSONfailedreflects the effective policy outcome, not just baseline state.Backwards compatibility
All new config keys are optional with safe fallbacks (invalid
group_by/mode→ defaults;min_coverageclamped to 0–100). Existing baseline behaviour is unchanged when none are set.Testing
vendor/bin/pest— 25 passed (+6 over baseline).vendor/bin/pint --testpasses; verified under bothprefer-lowestandprefer-stable.🤖 Generated with Claude Code