gocodebox / lifterlms-cs

PHP_CodeSniffer rules for LifterLMS projects
MIT License
3 stars 4 forks source link

No files are checked if path contains "wordpress" #3

Closed pondermatic closed 3 years ago

pondermatic commented 3 years ago

Reproduction Steps

If the path to LifterLMS contains wordpress, then no files are checked. In my development environment, the path is C:\Vistacast\WordPress\src\wp-content\plugins\lifterlms\.

Files are checked if lifterlms-cs/LifterLMS/ruleset.xml is changed.

-    <exclude-pattern>wordpress/*</exclude-pattern>
+    <exclude-pattern>^/wordpress/*</exclude-pattern>

Expected Behavior

$ vendor/bin/phpcs -v
Registering sniffs in the LifterLMS Core standard... DONE (257 sniffs registered)
Creating file list... DONE (744 files in queue)
...

Actual Behavior

$ vendor/bin/phpcs -v
Registering sniffs in the LifterLMS Core standard... DONE (257 sniffs registered)
Creating file list... DONE (0 files in queue)

System and Environment Information

Windows 10 PHP 7.4

This issue has be recreated:

pondermatic commented 3 years ago

@thomasplevy, is the purpose of the wordpress/* exclusion pattern to prevent checking files in tmp/tests/wordpress/? If so, then the tmp/* exclusion pattern takes care of that.

thomasplevy commented 3 years ago

This is a holdover from an older version of testing data that installed WP core into the wordpress/ at the root of the repo.

It can be removed fully as we never install WP into that directory anymore in any of our repos