automattic/phpcs-neutron-ruleset
Neutron ruleset for PHP_CodeSniffer from Automattic. Provides opinionated coding standards and sniffs to enforce consistent PHP style across projects, helping catch formatting and quality issues in CI and local development.
WordPress.DB.Prefix, WordPress.Security.Nonce.Verification).phpcs CLI or tools like php-cs-fixer).baiz/phplint-action).phpcs.xml).composer require automattic/phpcs-neutron-ruleset).- name: PHPCS Neutron
run: vendor/bin/phpcs --standard=./vendor/automattic/phpcs-neutron-ruleset --extensions=php src/
composer.json:
"require-dev": {
"phpcs/phpcs": "^3.7",
"automattic/phpcs-neutron-ruleset": "dev-main"
}
php-cs-fixer (auto-fixing vs. linting).phpcs.xml snippet:
<config name="installedPaths" value="./vendor/automattic/phpcs-neutron-ruleset"/>
<rule ref="WordPress" />
<rule ref="WordPressVIPMinimum" />
<rule ref="WordPressSecurity" />
<rule ref="WordPressDatabase" />
<rule ref="WordPressXSS" />
WordPress.Commenting.FunctionComment).<rule> tags.phpcs).#wordpress-polyglots Slack).--verbose logs.vendor/automattic/phpcs-neutron-ruleset/ruleset.xml).php-parallel-lint).| Failure Type | Impact | Mitigation |
|---|---|---|
| PHPCS Version Mismatch | Rules break due to PHPCS updates. | Pin PHPCS version in composer.json. |
| Rule Overhead | False positives block PRs. | Customize ruleset; use --ignore flags. |
| Stale Rules | Outdated WordPress patterns. | Fork and update rules as needed. |
| CI Pipeline Failures | Builds break due to new violations. | Gradual enforcement; allow exceptions. |
| Tooling Conflicts | Clashes with php-cs-fixer. |
Run PHPCS and fixer in separate stages. |
How can I help you explore Laravel packages today?