Environment and development tools: Difference between revisions

Jump to navigation Jump to search
m
Tags: Mobile edit Mobile web edit Advanced mobile edit
Tag: 2017 source edit
Line 122: Line 122:
https://github.com/Dolibarr/dolibarr/tree/develop/dev/setup/pre-commit
https://github.com/Dolibarr/dolibarr/tree/develop/dev/setup/pre-commit


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).  
Such hooks will work when using git 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. If something is wrong in the syntax, the commit will be immediately canceled. If it can be fixed automatically, phpcbf, installed during the install of the precommit hook, will fix it so you just have to try the commit a second time to have it validated.
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. If something is wrong in the syntax, the commit will be immediately canceled. If it can be fixed automatically, phpcbf, installed during the install of the precommit hook, will fix it so you just have to try the commit a second time to have it validated.

Navigation menu