Improve validate command + docs - #4
Merged
Merged
Conversation
An empty path argument (`validate ""`, or an unset shell variable) silently validated the current directory. Treat it as the mistake it is and reject it; an omitted argument still defaults to cwd.
A 344-byte manifest of nested YAML aliases hung `validate` for tens of seconds (unbounded past 10 levels). js-yaml returns aliases as shared references cheaply, but the downstream placeholder scan and Ajv walk expand them into an exponential tree. Setting maxAliases to 0 rejects anchors/aliases at parse time; a manifest never needs them.
Rule 7 only matched a PHP version when it sat immediately after the `php:` key, so a matrix written as a YAML flow array (`php: [8.2, 8.3]`) or block sequence — the most common GitHub Actions forms — was reported as missing, falsely failing a conformant integration. Parse the value region after each php/php-version key across all three list styles.
aswasif007
marked this pull request as ready for review
July 30, 2026 06:43
Rule 7 had two holes. The WordPress check was a bare full-text scan, so a `node: [6.9, 7.0]` matrix with no WP key passed as WP coverage — a false pass on the gate's core job. The PHP key regex was singular-only, so the common `php-versions:` (plural) matrix key false-failed a conformant integration. Generalize the key-scoped collector to both checks: scope WordPress to a wp/wordpress key like PHP, and accept php-versions/wp-versions plural. The collector also bounds a flow-mapping value at the next entry and strips inline comments, so a same-line neighbor key or a trailing comment no longer leaks versions into the scan.
The config cross-check warns, not fails, and is a best-effort heuristic read of the PHP source — not deterministic. The doc implied a mismatch blocks conformance, which would mislead a partner. Also correct the colors helper line count.
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.
What
In this PR we are improving the
validatecommand.inspectManifest()now loads withmaxAliases: 0, rejecting anchors/aliases at parse timeRule 7 only counted a PHP version when it sat immediately after the
php:key, so a CI matrix written as a YAML flow array (php: [8.2, 8.3, 8.4, 8.5]) or block sequence was missing.validatepathvalidate ""(or an unset shell variable) silently validated the current directory. It now errors with exit 1; an omitted argument still defaults to cwd.