Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/seanhamlin/drupal-pre-commit
A Drupal pre-commit hook to help write better code.
https://github.com/seanhamlin/drupal-pre-commit
Last synced: 2 months ago
JSON representation
A Drupal pre-commit hook to help write better code.
- Host: GitHub
- URL: https://github.com/seanhamlin/drupal-pre-commit
- Owner: seanhamlin
- License: mit
- Created: 2014-12-03T03:28:44.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-03-28T20:33:47.000Z (almost 9 years ago)
- Last Synced: 2024-10-11T02:11:42.180Z (3 months ago)
- Language: Shell
- Size: 8.79 KB
- Stars: 18
- Watchers: 6
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.TXT
Awesome Lists containing this project
README
# Drupal pre-commit hook #
For more information [see the blog post on pixelite](http://www.pixelite.co.nz/article/using-git-pre-commit-hooks-keep-you-drupal-codebase-clean). 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 warningI am also wanting people to submit pull requests as well.