utexas/forty_acres

Default Drupal theme used with the UT Drupal Kit

Installs: 88 522

Dependents: 1

Suggesters: 0

Security: 0

Stars: 1

Watchers: 4

Forks: 0

Language:CSS

Type:drupal-custom-theme


README

Pre-commit hooks

You now have a pre-commit file in your .github/ directory. It is pre-configured to check PHP code syntax (using PHP_CodeSniffer).

For the pre-commit hooks, a little setup is involved.

  1. Allow your custom pre-commit hook to be executable:
chmod +x .github/pre-commit
  1. Tell your repository to look in .github/ for hooks:
git config core.hooksPath .github/
  1. Add application-specific configuration:
cp .github/example.config.sh .github/config.sh

For PHP projects, follow the instructions for installing PHP Codesniffer.

If you want to use one/some of the checks, or add your own, add or remove them in the pre-commit file.

Usage

Easy-peasy. Run git commit commands as you would normally. The pre-commit check will execute automatically, and you'll get output along the lines of:

git commit -m "Update pre-commit checks" -a

Running pre-commit checks...
To bypass this check, add '--no-verify' to your commit command

Sniffing staged files via PHP Code Sniffer...