Skip to content

Commit

Permalink
Add docs on code reviews.
Browse files Browse the repository at this point in the history
  • Loading branch information
becw committed Nov 21, 2016
1 parent 8a6ee52 commit 2d4af48
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions docs/code_review.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Code Review in the-build

From your project where you have installed the-build, run `vendor/bin/phing code-review` to run the default set of code reviews. This target is provided in the default `build.xml` created for your project during install.

This will review your code with:

* Drupal Codesniffer
* PHPmd
* PHP Lint
* PHPtodo

Generally, you should configure your `build.xml` to run code reviews as part of your `test` target so that developers run the reviews by default.

### PHP Lint

PHP Lint uses the PHP interpreter directly to check for syntax errors. There is no configuration for this review.

### [PHPMD](https://phpmd.org/)

A more complicated and more general PHP code review than the Drupal Codesniffer standard. The default config for this review can be found within the-build at `conf/phpmd.xml`. To customize this config, copy that file to your project's `conf/` directory and add the build property:

```
phpmd.rulesets=conf/phpmd.xml
```

### Drupal Codesniffer

Runs codesniffer using the standard provided by Drupal's [Coder](https://www.drupal.org/project/coder) module. Generally, you should not change the configuration for this review, but if do need to you can provide a different standard:

```
drupal_code_sniffer.standard=vendor/drupal/coder/coder_sniffer/Drupal/ruleset.xml
```

### [PHP To-do Finder](https://github.com/nilportugues/php-todo-finder)

Sets a threshold for the number of "to do" comments allowable in a codebase. The default config for this review can be found within the-build at `conf/php_todo_finder.yml`. To customize this config, copy that file to your project's `conf/` directory and add the build property:

```
phptodo.config=conf/php_todo_finder.yml
```

0 comments on commit 2d4af48

Please sign in to comment.