Skip to content

Commit e5d43ab

Browse files
committed
docs: add composer scripts examples to Usage section
1 parent 2f2db2a commit e5d43ab

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

README.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,22 @@ $rules = \IxDFCodingStandard\PhpCsFixer\Rules::get();
6969

7070
## Usage
7171

72+
Add composer scripts to your `composer.json`:
73+
74+
```json
75+
"scripts": {
76+
"cs:check": "phpcs -p -s --colors --report-full --report-summary",
77+
"cs:fix": "phpcbf -p --colors",
78+
"cs-fixer:check": "php-cs-fixer fix --dry-run --diff",
79+
"cs-fixer:fix": "php-cs-fixer fix"
80+
}
81+
```
82+
83+
Then run:
84+
7285
```shell
73-
composer cs:check # check only
74-
composer cs:fix # auto-fix
86+
composer cs:check # PHP_CodeSniffer: check only
87+
composer cs:fix # PHP_CodeSniffer: auto-fix
88+
composer cs-fixer:check # PHP-CS-Fixer: check only
89+
composer cs-fixer:fix # PHP-CS-Fixer: auto-fix
7590
```

0 commit comments

Comments
 (0)