Problem
Right now PHPCS warnings on indentation / array-arrow alignment / whitespace fire on PRs and have to be fixed by hand. Examples we've hit recently:
WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned (multi-line array arrows)
- Tab-vs-space inconsistencies from editors with different defaults
- Indentation regressions inside top-level code blocks
These are 100% mechanical and PHPCBF (the phpcs autofixer) resolves them deterministically. Asking external contributors to chase them down is friction we don't want — especially as the substrate is trying to attract OSS adopters.
Proposal
Easiest path, in priority order:
composer run lint:fix script — "lint:fix": "phpcbf --standard=phpcs.xml --extensions=php src/ tests/". Documented in CONTRIBUTING.md so contributors can run it locally before push.
- CI suggestion job — On PR, run
phpcbf and post the resulting diff as a review comment with a one-click "apply suggestion" so contributors can accept without leaving the PR.
- Auto-commit on internal branches — For PRs from collaborators with write access, optionally auto-commit the phpcbf diff back to the branch.
Acceptance
Why
Sniff-fixable whitespace warnings should never be a contributor's problem — they're a tooling problem. The substance of a substrate review is interface design, not tab indentation.
Problem
Right now PHPCS warnings on indentation / array-arrow alignment / whitespace fire on PRs and have to be fixed by hand. Examples we've hit recently:
WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned(multi-line array arrows)These are 100% mechanical and PHPCBF (the phpcs autofixer) resolves them deterministically. Asking external contributors to chase them down is friction we don't want — especially as the substrate is trying to attract OSS adopters.
Proposal
Easiest path, in priority order:
composer run lint:fixscript —"lint:fix": "phpcbf --standard=phpcs.xml --extensions=php src/ tests/". Documented in CONTRIBUTING.md so contributors can run it locally before push.phpcbfand post the resulting diff as a review comment with a one-click "apply suggestion" so contributors can accept without leaving the PR.Acceptance
composer run lint:fixautofixes sniff-fixable issues locallyWhy
Sniff-fixable whitespace warnings should never be a contributor's problem — they're a tooling problem. The substance of a substrate review is interface design, not tab indentation.