Skip to content

Commit b5dffff

Browse files
committed
Add WP Coding Standards as a dependency
Previously WPCS had to be installed as some global thing, now you can just run `composer install` and use $ vendor/bin/phpcs ./ to run PHPCS checks on the codebase.
1 parent 735408c commit b5dffff

3 files changed

Lines changed: 202 additions & 8 deletions

File tree

composer.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,9 @@
1212
],
1313
"require": {
1414
"php": ">=5.3.0"
15+
},
16+
"require-dev": {
17+
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.4",
18+
"wp-coding-standards/wpcs": "0.12.0"
1519
}
1620
}

composer.lock

Lines changed: 189 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

phpcs.xml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@
22
<ruleset name="anttiviljami-wordpress">
33
<description>For nicer WordPress and PHP development</description>
44

5-
<!-- Don't check composer dependencies -->
6-
<exclude-pattern>/vendor/</exclude-pattern>
7-
8-
<!-- Exclude language files -->
9-
<exclude-pattern>/lang/</exclude-pattern>
5+
<!-- Files and directories to parse -->
6+
<file>./classes/</file>
7+
<file>./inc/</file>
8+
<file>./wp-libre-form.php</file>
9+
10+
<!-- Excluded directories and files -->
11+
<exclude-pattern>*/vendor/*</exclude-pattern>
12+
<exclude-pattern>*/lang/*</exclude-pattern>
13+
<exclude-pattern>*/assets/*</exclude-pattern>
1014

1115
<!-- Disallow tabs altogether -->
1216
<rule ref="Generic.WhiteSpace.DisallowTabIndent.TabsUsed"/>

0 commit comments

Comments
 (0)