Skip to content

Commit 35e568f

Browse files
authored
Merge pull request #6 from 26B/feature/advise-to-use-local-codesniffer
2 parents 9b785db + e6df1ae commit 35e568f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
Pre-commit git hook for enforcing php standards.
44

5-
Currently uses PHP_CodeSniffer and corrects .php staged files according to a phpcs config file (usually a phpcs.xml).
5+
Currently uses PHP_CodeSniffer (PHPCS) and corrects .php staged files according to a phpcs config file (usually a phpcs.xml).
66

7-
This package **does not require** PHP_CodeSniffer because it is up to you whether you want to use a local or global `phpcs`. Local `phpcs` takes precedence when the pre-commit runs. You can require them in the following way:
7+
This package **does not require** PHPCS because it is up to you whether you want to use a local or global `phpcs`. Local `phpcs` takes precedence when the pre-commit runs. You can require them in the following way:
88

99
```bash
1010
# Local
@@ -34,6 +34,12 @@ If you want to skip the pre-commit execution, you can add the argument `--no-ver
3434

3535
## Use Cases
3636

37+
### Local PHPCS
38+
39+
If you intend to use different sets of standards in different repositories we advise you to install `php_codesniffer` locally, this will make sure that there will be no conflicts when configuring `phpcs --config-set ...` later on. In case you choose the local approach make sure to correct the PHPCS path on the examples below.
40+
41+
Usually it would be something like changing all `phpcs` references to `./vendor/bin/phpcs` (or any other local path).
42+
3743
### WordPress
3844

3945
#### Setup WordPress Standards (Manual)

0 commit comments

Comments
 (0)