Skip to content

asidbackup/drupal-pre-commit

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Drupal pre-commit hook

For more information see the blog post on pixelite. If this script has helped you or you want to leave a comment, you can do so on the blog.

Installation instructions

This is covered in the actual script as well, but for the sake of making it easy to find:

cd [PATH TO DRUPAL GIT REPO]
mkdir scripts
curl -sL https://raw.githubusercontent.com/wiifm69/drupal-pre-commit/master/scripts/pre-commit.sh > ./scripts/pre-commit.sh
ln -s ../../scripts/pre-commit.sh .git/hooks/pre-commit

On a side note, I normally encourage your Drupal docroot to be in a sub folder called docroot, this way the scripts directory will not be served via your web server.

Possible enhancements

  • JavaScript linting
  • Drupal Code Standards (phpcs + coder) integration
  • Having some configuration options (perhaps environment variables?) as to what will cause a the commit to fail, versus a warning

I am also wanting people to submit pull requests as well.

About

A Drupal pre-commit hook to help write better code.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%