Environment and development tools: Difference between revisions

Jump to navigation Jump to search
m
Tag: 2017 source edit
Tag: 2017 source edit
Line 71: Line 71:
== Git Hooks ==
== Git Hooks ==


=== Install Pre-commit git hook ===
=== Install Pre-commit githook ===
You can use git hooks to check the syntax of the file you commit and cancel (or better autofix) the commit if something is wrong. You need '''phpcs''' command line tool for this (sudo apt-get -y install php-codesniffer). If you have '''phpcbf''' installed, you can also fix the files automatically. This is how to:
You can use git hooks to check the syntax of the file you commit and cancel (or better autofix) the commit if something is wrong. You need '''phpcs''' command line tool for this (sudo apt-get -y install php-codesniffer). If you have '''phpcbf''' installed, you can also fix the files automatically. This is how to:


Navigation menu