This script has the goal of improving the development of custom code for themes, modules oriented to drupal and general code. It validates Drupal coding standards on files before commit them and returns a message to fix each line of code on the files having errors.
Follow next steps to set up pre commit git hook with Drupal coding standards:
- composer require drupal/coder dealerdirect/phpcodesniffer-composer-installer
- Create hooks directory on root project.
- Create pre-commit file into hooks directory.