Skip to content

barbun/commit-tools

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pre-commit tools

Pre-commit tools for Acquia Cloud Drupal projects. Performs quality assurance tasks for each commit made against a project. Code will not be able to be commited until it passes the minimum quality standards.

The tool uses PHPCS, PHP Unit and Drupal Coder. These tools will be installed locally to the project so as not to conflict with other installed versions.

Dependencies

  • Acquia Cloud hosting directory structure
  • git
  • php
  • wget

Initial Setup

wget https://raw.githubusercontent.com/steveworley/commit-tools/master/setup -v -O setup && chmod +x ./setup && ./setup develop

Alternatively:

  • Download setup
  • Configure the upstream
  • Execute setup

The setup file should be committed to the project repo so that developers can run ./setup prior to starting work. This will ensure that all pre-commit tasks are available.

Arguments

The setup script will accept a number of arguments to help generate the required files for the project.

UPSTREAM

The upstream branch that this project will use.

PREFIX

The project prefix. Typically should match the JIRA prefix.

LENGTH

The minimum length a commit message can be.

Example

wget https://raw.githubusercontent.com/steveworley/commit-tools/master/setup -v -O setup && chmod +x ./setup && ./setup develop PRO 20

Any arguments provided will be used to update the setup script so that subsequent runs can install dependencies without knowledge of configuration.

Configuration

Alter the setup file and change the configuration variables so they match your project.

  • UPSTREAM [default: master]: A branch that is considered the upstream. This will be the branch that is used to generate the diff when determining which files to validate.
  • TASKS [default: (code-review.sh tests.sh)]: A list of tasks that you want to include with this project. These will be downloaded from tasks so only files available here can be used.
  • PREFIX [default: PROJ]: Prefix used for commit messages typically set to JIRA project name
  • LENGTH [default: 15]: Minimum length for commit messages

Developer setup

When a new developer picks up the project they will be required to run the ./setup script, this will ensure that all tools are downloaded and everything is setup ready for them to begin committing code.

Notes

  • Hooks can be skipped by adding the --no-verify option when committing

About

Acquia Cloud Pre-commit tools

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%