Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to WordPress-VIP-Go standards #1050

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: lint phpunit phpdoc phpcs phpcbf clean
.PHONY: lint phpunit phpdoc initphpcs phpcs phpcbf clean

test: lint phpunit phpcs

Expand All @@ -13,20 +13,20 @@ phpunit:
phpdoc:
phpdoc run --no-interaction

phpcs:
initphpcs:
test -f /tmp/phpcs || curl -L https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar -o /tmp/phpcs && chmod +x /tmp/phpcs
test -d /tmp/wpcs || git clone -b master --depth 1 https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git /tmp/wpcs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WPCS master and VIPCS master are not yet compatible.

The safest option for now, is to checkout the 1.2.1 tag of WPCS, and the 0.4.0 tag of VIPCS.

I'll make it clear in VIP when a release of VIPCS is compatible with WPCS master.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VIPCS 2.0 has been released, and it is compatible with WPCS 2.1+.

/tmp/phpcs --config-set installed_paths /tmp/wpcs
/tmp/phpcs -p . --severity=6 --standard=phpcs.xml --extensions=php --runtime-set ignore_warnings_on_exit true
test -d /tmp/vipcs || git clone -b master --depth 1 https://github.com/Automattic/VIP-Coding-Standards.git /tmp/vipcs
/tmp/phpcs --config-set installed_paths /tmp/wpcs,/tmp/vipcs

phpcbf:
test -f /tmp/phpcs || curl -L https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar -o /tmp/phpcs && chmod +x /tmp/phpcs
test -f /tmp/phpcbf || curl -L https://squizlabs.github.io/PHP_CodeSniffer/phpcbf.phar -o /tmp/phpcbf && chmod +x /tmp/phpcbf
test -d /tmp/wpcs || git clone -b master --depth 1 https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git /tmp/wpcs
/tmp/phpcs --config-set installed_paths /tmp/wpcs
phpcs: initphpcs
/tmp/phpcs -p . --severity=6 --standard=phpcs.xml --extensions=php --runtime-set ignore_warnings_on_exit true --runtime-set ignore_errors_on_exit true

phpcbf: initphpcs
/tmp/phpcbf -p . --standard=phpcs.xml --extensions=php

clean:
rm -rf /tmp/phpcs
rm -rf /tmp/phpcbf
rm -rf /tmp/wpcs
rm -rf /tmp/vipcs
4 changes: 2 additions & 2 deletions phpcs.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<ruleset name="VIP-Go-mu-plugins">
<ruleset name="vip-go-mu-plugins">
<description>VIP Go mu-plugins</description>

<config name="ignore_warnings_on_exit">true</config>
Expand All @@ -24,5 +24,5 @@
<exclude-pattern>wordpress-importer/*</exclude-pattern>
<exclude-pattern>wp-cron-control/*</exclude-pattern>

<rule ref="WordPress-VIP"/>
<rule ref="WordPress-VIP-Go"/>
</ruleset>