diff --git a/README.md b/README.md index 24443ef..c0d6ced 100644 --- a/README.md +++ b/README.md @@ -7,22 +7,12 @@ Currently works primarly against Drupal ## Installation -### Phar (recommended) - -You may get dependency conflicts when using composer, so a phar installation is often easiest. - ``` wget https://github.com/smmccabe/phpdebt/releases/download/1.0.1/phpdebt.phar chmod +x phpdebt.phar sudo mv phpdebt.phar /usr/local/bin/phpdebt ``` -### Composer - -``` -composer require smmccabe/phpdebt -``` - ## Usage and Examples Against a whole project diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..6250d1c --- /dev/null +++ b/build.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +cp vendor/drupal/coder/coder_sniffer/Drupal/ vendor/squizlabs/php_codesniffer/src/Standards/ -r +cp vendor/drupal/coder/coder_sniffer/DrupalPractice/ vendor/squizlabs/php_codesniffer/src/Standards/ -r +./vendor/bin/phar-composer build . \ No newline at end of file diff --git a/src/index.php b/src/index.php index 5917555..71c9a36 100644 --- a/src/index.php +++ b/src/index.php @@ -44,7 +44,7 @@ function phpMD($path, $type) { $runner->config = new Config(); $runner->config->files = [$path]; -$runner->config->standards = ['./vendor/drupal/coder/coder_sniffer/Drupal']; +$runner->config->standards = ['Drupal']; $runner->config->extensions = [ 'php' => 'PHP', 'module' => 'PHP', @@ -63,7 +63,8 @@ function phpMD($path, $type) { print "phpcs Drupal: " . $faults . "\n"; $standards_faults += $faults; -$runner->config->standards = ['./vendor/drupal/coder/coder_sniffer/DrupalPractice']; +$runner->config->standards = ['DrupalPractice']; +$runner->init(); $faults = $runner->run(); print "phpcs DrupalPractice: " . $faults . "\n"; $standards_faults += $faults;