You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-2Lines changed: 8 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,9 @@
2
2
3
3
Pre-commit git hook for enforcing php standards.
4
4
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).
6
6
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:
8
8
9
9
```bash
10
10
# Local
@@ -34,6 +34,12 @@ If you want to skip the pre-commit execution, you can add the argument `--no-ver
34
34
35
35
## Use Cases
36
36
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).
0 commit comments