31,003
edits
Tag: 2017 source edit |
Tag: 2017 source edit |
||
| Line 76: | Line 76: | ||
Next, you need to edit pre-commit file in .git/hooks to modify the DIRPHPCS variable to set the path of your phpcs and phpcbf tool (you can keep them empty if tools ara available into your PATH). | Next, you need to edit pre-commit file in .git/hooks to modify the DIRPHPCS variable to set the path of your phpcs and phpcbf tool (you can keep them empty if tools ara available into your PATH). | ||
Such hooks will work when using on command line but may also work when committing using your common IDE (it has been validated with Eclipse and VSC). | |||
Once installed, the hook will start on your next commit to re-format your code, so your code will always match the coding syntax rules. If everybody enable this hook, everybody will use the same coding syntax rule, so it is highly recommended to enable it if you can. | Once installed, the hook will start on your next commit to re-format your code, so your code will always match the coding syntax rules. If everybody enable this hook, everybody will use the same coding syntax rule, so it is highly recommended to enable it if you can. | ||