You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(scaffolds): ask for lint/phpstan paths instead of hardcoding them - #84
Fixes the lint/phpstan scaffold. Its config hardcoded src and includes, and PHPStan stops on a listed path that doesn't exist, so composer analyse failed in any project without both. The scaffold now asks for the paths to analyse through a required paths input, so it works on any PHP project: plugins, themes, or Composer packages like rtcamp/wp-primitives.
Required paths input: comma-separated (--paths='inc/, my-plugin.php') and rendered as a NEON inline list, paths: [inc/, my-plugin.php]. It has no default, so interactive runs prompt for it and --non-interactive runs without it fail with EMISSINGINPUT instead of writing a broken config.
Excludes shrink to optional vendor and node_modules: they only matter when paths includes ..
Docs: the setup skill and docs/examples.md pass --paths in their lint/phpstan commands.
Tests: supplied paths render verbatim; a missing paths is refused.
How I verified
❯ npm run check
Test Suites: 82 passed, 82 total
Tests: 1377 passed, 1377 total
Snapshots: 0 total
PHPStan 2.3.1 on scaffolded projects: --paths='inc/, acme.php' analyses with no errors, and --paths=. reports the project's own errors and nothing from vendor/.
Acceptance criteria
Runtime behavior
Fresh scaffold + composer analyse runs with no path errors, whatever the project layout
A missing paths input is refused, never guessed
Code quality
Lint — zero errors
Static analysis — zero errors
Tests pass
Housekeeping
CHANGELOG.md entry under ## Unreleased
Reviewer notes
This replaces the first approach on this PR, which discovered paths through two new engine sources (entry-file:, exists:). Guessing silently skipped PHP outside its list and rendered an empty paths: when nothing matched, so that code is reverted.
rtcamp/wp-phpstan stays ^1.0 — the ^2.0 bump follows the wp-phpstan release that ships level 8, as its own change.
Constants defined at runtime (define() inside a function) still need the project's own bootstrapFiles.
Updates the PHPStan scaffold to discover existing project paths instead of hardcoding src and includes, using reusable scaffold-engine discovery sources.
Changes:
Adds entry-file:<type> and exists:<path> discovery sources and validation support.
Conditionally renders PHPStan analysis paths and removes the previous exclusions.
Adds discovery and rendering tests, authoring documentation, and a changelog entry.
Adi-ty
changed the title
fix(scaffolds): list only existing PHP paths in the lint/phpstan config
fix(scaffolds): ask for lint/phpstan paths instead of hardcoding them
Oct 22, 2026
This checks the value after resolveDeclared() has applied its transform. Both setup/pa11y and setup/perf declare a required base_url with json-escape, so an actual tab-only or newline-only input becomes the nonblank text \t or \n. It therefore bypasses this check and renders an unusable URL instead of raising EMISSINGINPUT. Validate required values before escaping, while preserving post-transform enum validation and the resolver's partial-resolution behavior. Add regression cases for tab-only and newline-only values on a transformed required input.
Review effort: Balanced
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
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.
What this PR does
Fixes the
lint/phpstanscaffold. Its config hardcodedsrcandincludes, and PHPStan stops on a listed path that doesn't exist, socomposer analysefailed in any project without both. The scaffold now asks for the paths to analyse through a requiredpathsinput, so it works on any PHP project: plugins, themes, or Composer packages like rtcamp/wp-primitives.Stacked on #83: merge that first.
Closes
N/A
Changes
pathsinput: comma-separated (--paths='inc/, my-plugin.php') and rendered as a NEON inline list,paths: [inc/, my-plugin.php]. It has no default, so interactive runs prompt for it and--non-interactiveruns without it fail withEMISSINGINPUTinstead of writing a broken config.vendorandnode_modules: they only matter whenpathsincludes..docs/examples.mdpass--pathsin theirlint/phpstancommands.pathsis refused.How I verified
PHPStan 2.3.1 on scaffolded projects:
--paths='inc/, acme.php'analyses with no errors, and--paths=.reports the project's own errors and nothing fromvendor/.Acceptance criteria
Runtime behavior
composer analyseruns with no path errors, whatever the project layoutpathsinput is refused, never guessedCode quality
Housekeeping
CHANGELOG.mdentry under## UnreleasedReviewer notes
entry-file:,exists:). Guessing silently skipped PHP outside its list and rendered an emptypaths:when nothing matched, so that code is reverted.define()inside a function) still need the project's ownbootstrapFiles.