diff --git a/bespoke-phpcs b/bespoke-phpcs index d6e0a4a..b5323cb 100755 --- a/bespoke-phpcs +++ b/bespoke-phpcs @@ -6,6 +6,7 @@ if (count($_SERVER['argv']) >1) { die; } +$_SERVER['argv'][] = '-s'; // Include sniff codes $_SERVER['argv'][] = 'app'; // scan app folder // Use rules defined in project root or by default what defined in bespoke standards diff --git a/bespoke-phpcs-report-source b/bespoke-phpcs-report-source new file mode 100755 index 0000000..a722de2 --- /dev/null +++ b/bespoke-phpcs-report-source @@ -0,0 +1,23 @@ +#!/usr/bin/env php + 1) { + echo "⚠️ Sorry. Parameters are currently not supported." . PHP_EOL; + die; +} + +// source +$_SERVER['argv'][] = '--report=source'; + +$_SERVER['argv'][] = 'app'; // scan app folder + +// Use rules defined in project root or by default what defined in bespoke standards +if (file_exists(__DIR__ . '/../../../phpcs.xml')) { + $_SERVER['argv'][] = '--standard=phpcs.xml'; +} else { + $_SERVER['argv'][] = '--standard=' . __DIR__ . '/ruleset.xml'; // rules +} +$_SERVER['argv'][] = '--extensions=php'; // only php files +$_SERVER['argv'][] = '--encoding=utf-8'; + +include __DIR__ . '/../../bin/phpcs'; diff --git a/bespoke-phpcs-report-summary b/bespoke-phpcs-report-summary new file mode 100755 index 0000000..8f9a6db --- /dev/null +++ b/bespoke-phpcs-report-summary @@ -0,0 +1,23 @@ +#!/usr/bin/env php + 1) { + echo "⚠️ Sorry. Parameters are currently not supported." . PHP_EOL; + die; +} + +// Summary +$_SERVER['argv'][] = '--report=summary'; + +$_SERVER['argv'][] = 'app'; // scan app folder + +// Use rules defined in project root or by default what defined in bespoke standards +if (file_exists(__DIR__ . '/../../../phpcs.xml')) { + $_SERVER['argv'][] = '--standard=phpcs.xml'; +} else { + $_SERVER['argv'][] = '--standard=' . __DIR__ . '/ruleset.xml'; // rules +} +$_SERVER['argv'][] = '--extensions=php'; // only php files +$_SERVER['argv'][] = '--encoding=utf-8'; + +include __DIR__ . '/../../bin/phpcs'; diff --git a/composer.json b/composer.json index 1ba4511..9381e08 100644 --- a/composer.json +++ b/composer.json @@ -15,6 +15,8 @@ "bin": [ "bespoke-phpcbf", "bespoke-phpcs", + "bespoke-phpcs-report-source", + "bespoke-phpcs-report-summary", "bespoke-phplint" ], "require": { diff --git a/ruleset.xml b/ruleset.xml index fffbe9e..198ca7e 100644 --- a/ruleset.xml +++ b/ruleset.xml @@ -6,10 +6,9 @@ ./vendor/* */thirdparty/* - + -