wp-enforcer icon indicating copy to clipboard operation
wp-enforcer copied to clipboard

Script overwrites installed coding standards

Open morganestes opened this issue 6 years ago • 2 comments

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.

morganestes avatar Jul 18 '17 21:07 morganestes

Morgan, thanks for bringing this to my attention!

stevegrunwell avatar Jul 19 '17 13:07 stevegrunwell

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.

stevegrunwell avatar May 25 '18 19:05 stevegrunwell