Skip to content

Commit

Permalink
235: added phpcs installed_paths from composer
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidSingh3 committed Oct 22, 2021
1 parent b844238 commit 1a9e737
Show file tree
Hide file tree
Showing 7 changed files with 317 additions and 59 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ plugin-sources
tmp
.idea/
.vscode/
cybot-cookiebot-*.zip
cybot-cookiebot-*.zip
/tests/vendor/
46 changes: 0 additions & 46 deletions .phpcs-local.xml

This file was deleted.

3 changes: 3 additions & 0 deletions .phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
<ruleset name="WordPress Coding Standards based custom ruleset for your plugin">
<description>Generally-applicable sniffs for WordPress plugins.</description>

<config name="installed_paths"
value="tests/vendor/wp-coding-standards/wpcs,tests/vendor/phpcompatibility/php-compatibility,tests/vendor/phpcompatibility/phpcompatibility-paragonie,tests/vendor/phpcompatibility/phpcompatibility-wp"
/>
<!-- What to scan -->
<file>.</file>
<exclude-pattern>/vendor/</exclude-pattern>
Expand Down
10 changes: 2 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,7 @@ before_script:
fi
- |
if [ "$PHPCS" == "1" ]; then
composer require squizlabs/php_codesniffer
composer require wp-coding-standards/wpcs
composer require phpcompatibility/php-compatibility
composer require phpcompatibility/phpcompatibility-paragonie
composer require phpcompatibility/phpcompatibility-wp
composer install
vendor/bin/phpcs --config-set installed_paths vendor/wp-coding-standards/wpcs,vendor/phpcompatibility/php-compatibility,vendor/phpcompatibility/phpcompatibility-paragonie,vendor/phpcompatibility/phpcompatibility-wp
(cd tests && composer install)
else
bash bin/install-wp-tests.sh wordpress_test root '' localhost latest
wget https://phar.phpunit.de/phpunit-$PHPUNIT_VERSION.phar -O /tmp/phpunit
Expand All @@ -55,7 +49,7 @@ before_script:
script:
- |
if [ "$PHPCS" == "1" ]; then
vendor/bin/phpcs
tests/vendor/bin/phpcs
else
/tmp/phpunit
WP_MULTISITE=1 /tmp/phpunit
Expand Down
7 changes: 3 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
}
},
"scripts": {
"docker.phpunit": "cd tests && docker-compose run cookiebot phpunit",
"docker.phpcs": "cd tests && docker-compose run cookiebot phpcs",
"phpcs": "phpcs --standard=./.phpcs-local.xml ./",
"phpcbf": "phpcbf --standard=./.phpcs-local.xml ./"
"phpunit": "cd tests && docker-compose run cookiebot phpunit",
"phpcs": "tests/vendor/bin/phpcs",
"phpcbf": "tests/vendor/bin/phpcbf"
}
}
9 changes: 9 additions & 0 deletions tests/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"require-dev": {
"squizlabs/php_codesniffer": "^3.6",
"wp-coding-standards/wpcs": "^2.3",
"phpcompatibility/php-compatibility": "^9.3",
"phpcompatibility/phpcompatibility-paragonie": "^1.3",
"phpcompatibility/phpcompatibility-wp": "^2.1"
}
}
Loading

0 comments on commit 1a9e737

Please sign in to comment.