Skip to content

Instantly share code, notes, and snippets.

View arunkumarkuppuswamy's full-sized avatar
💪
Fear is Foolishness

Arunkumar Kuppuswamy arunkumarkuppuswamy

💪
Fear is Foolishness
  • Srijan Technologies
  • Coimbatore, Tamil nadu, India
  • X @arunkumarsks
View GitHub Profile
@preciado04
preciado04 / a-git-pre-commit-hook-phpcs-drupal-coding-standards.md
Last active July 31, 2024 14:12
Set up PHP CodeSniffer with Drupal coding standards on pre-commit git hook.

Set up PHP CodeSniffer with Drupal coding standards on pre-commit git hook.

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:

  1. composer require drupal/coder dealerdirect/phpcodesniffer-composer-installer
  2. Create hooks directory on root project.
  3. Create pre-commit file into hooks directory.