From 111efe74242c3ea25c9c917c2538c1f89668f9bb Mon Sep 17 00:00:00 2001 From: Mohammad Jangda Date: Thu, 20 Dec 2018 11:19:41 -0500 Subject: [PATCH 1/4] Switch to WordPress-VIP-Go standards --- phpcs.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpcs.xml b/phpcs.xml index f40406afd6..0a6cde891d 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -1,5 +1,5 @@ - + VIP Go mu-plugins true @@ -24,5 +24,5 @@ wordpress-importer/* wp-cron-control/* - + From e430c04a1550f78e37626d32c34e954681714cdd Mon Sep 17 00:00:00 2001 From: Mohammad Jangda Date: Wed, 26 Dec 2018 15:53:46 -0500 Subject: [PATCH 2/4] Check out VIP-Coding-Standards And use those with phpcs --- Makefile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index dfa7d3c582..857dafcb89 100644 --- a/Makefile +++ b/Makefile @@ -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 - /tmp/phpcs --config-set installed_paths /tmp/wpcs + 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 + +phpcs: initphpcs /tmp/phpcs -p . --severity=6 --standard=phpcs.xml --extensions=php --runtime-set ignore_warnings_on_exit true -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 +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 From 909b6585e8d248393479f93945e8a6629870a7cd Mon Sep 17 00:00:00 2001 From: Mohammad Jangda Date: Wed, 26 Dec 2018 15:56:06 -0500 Subject: [PATCH 3/4] Add initphpcs to PHONY --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 857dafcb89..1d9573ccc2 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: lint phpunit phpdoc phpcs phpcbf clean +.PHONY: lint phpunit phpdoc initphpcs phpcs phpcbf clean test: lint phpunit phpcs From 7bdb47787125a9176fa07aac1a05ca77736ce2e5 Mon Sep 17 00:00:00 2001 From: Mohammad Jangda Date: Mon, 7 Jan 2019 17:22:50 -0500 Subject: [PATCH 4/4] ignore_errors_on_exit = true for now Since there are still many errors we need to work through. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 1d9573ccc2..ea59ed6229 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ initphpcs: /tmp/phpcs --config-set installed_paths /tmp/wpcs,/tmp/vipcs phpcs: initphpcs - /tmp/phpcs -p . --severity=6 --standard=phpcs.xml --extensions=php --runtime-set ignore_warnings_on_exit true + /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