Skip to content

Commit

Permalink
Move drupal standards to count as built in standards
Browse files Browse the repository at this point in the history
  • Loading branch information
smmccabe committed Apr 23, 2020
1 parent 045be0a commit be46205
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
10 changes: 0 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -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 .
5 changes: 3 additions & 2 deletions src/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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;
Expand Down

0 comments on commit be46205

Please sign in to comment.