Skip to content

Commit

Permalink
Renamed standard and improved documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
tersmitten committed Jun 10, 2016
1 parent f3c1df2 commit 3afa821
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 24 deletions.
2 changes: 1 addition & 1 deletion Oefenweb/ruleset.xml → CakePHPOefenweb/ruleset.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<ruleset name="Oefenweb">
<ruleset name="CakePHPOefenweb">
<description>Oefenweb Code Sniffer for CakePHP</description>
<rule ref="../../../cakephp/cakephp-codesniffer/CakePHP">
<exclude name="Generic.Commenting.Todo"/>
Expand Down
28 changes: 5 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,19 @@ This code works with [phpcs](https://github.com/squizlabs/PHP_CodeSniffer) and c
It's generally recommended to install these code sniffs with `composer`:

```sh
composer global require --dev 'cakephp/cakephp-codesniffer=1.*';
```

Modify `~/.composer/composer.json`.

```json
"require-dev": {
"oefenweb/cakephp-codesniffer": "dev-master"
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/Oefenweb/cakephp-codesniffer"
}
]
mkdir CakePHPOefenweb && cd $_ && composer require oefenweb/cakephp-codesniffer=dev-master;
```

```sh
composer global update oefenweb/cakephp-codesniffer;
~/.composer/vendor/bin/phpcs --config-set \
installed_paths "${HOME}/.composer/vendor/cakephp/cakephp-codesniffer,${HOME}/.composer/vendor/oefenweb/cakephp-codesniffer";
vendor/bin/phpcs \
--config-set installed_paths "${PWD}/vendor/cakephp/cakephp-codesniffer,${PWD}/vendor/oefenweb/cakephp-codesniffer" \
;
```

This lets `phpcs` know where to find your new sniffs. Ensure that you do not overwrite any existing `installed_paths` value.

## Usage

When these sniffs are installed with `composer`, ensure that you have configured the CodeSniffer `installed_paths` setting.

Once `installed_paths` is configured, you can run phpcs using:

```sh
~/.composer/vendor/bin/phpcs . --standard=Oefenweb --extensions=ctp,php --ignore=app/Vendor --ignore=app/Plugin;
vendor/bin/phpcs --standard=CakePHPOefenweb ~/foo/bar/index.php;
```

0 comments on commit 3afa821

Please sign in to comment.