Skip to content

Commit

Permalink
phpcs improvements
Browse files Browse the repository at this point in the history
- don't search inside node_modules (inefficient)
- handle spaces inside PHP filenames (perhaps unnecessary)
- show rule codes in all reports (-s option)
  • Loading branch information
nylen committed May 5, 2017
1 parent 22a674c commit 5b3d7d8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ script:
fi
- |
if [[ "$TRAVISCI" == "phpcs" ]] ; then
phpcs --standard=phpcs.ruleset.xml $(find . -name '*.php')
find . \
-not \( -path './node_modules' \) \
-not \( -path './vendor' \) \
-name '*.php' \
| xargs -d'\n' phpcs --standard=phpcs.ruleset.xml -s
fi
- |
if [[ "$TRAVISCI" == "js" ]] ; then
Expand Down
3 changes: 0 additions & 3 deletions phpcs.ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,4 @@

<rule ref="WordPress-Core" />
<rule ref="WordPress-Docs" />

<exclude-pattern>*/node_modules/*</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>
</ruleset>

0 comments on commit 5b3d7d8

Please sign in to comment.