wp-enforcer
wp-enforcer copied to clipboard
Script overwrites installed coding standards
Problem
In version 0.5.0, when I run wp-enforcer
it removes the standards already set for a project.
Description
I have multiple coding standards installed in my project (WP Coding Standards and PHPCompatibility) and a script to set them for use with the project's PHPCS. When I run wp-enforcer
, it only checks for wp-coding-standards/wpcs
and removes the other standard on every run, which causes checks to fail because PHPCS can't find the expected sniffs.
Possible Resolution
It would be nice for WP Enforcer to honor the existing config and not remove the standards set, either by not forcing the standards inside the script or by appending wpcs to the installed_paths
only if it's not present already.
Morgan, thanks for bringing this to my attention!
Heh, just ran into this myself; I'm going to refactor to use dealerdirect/phpcodesniffer-composer-installer, which will simplify the code in WP Enforcer and reduce conflicts.