GithubHelp home page GithubHelp logo

commit-tools's Introduction

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

commit-tools's People

Contributors

steveworley avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.