Skip to content

sibizwolle/pre-commit-hooks

 
 

Repository files navigation

Motivo Pre-Commit hooks

A set of pre-commit hooks we found useful.

Description

This repository contains various pre-commit hooks we're just starting to collect.

License

MIT

Available pre-commit hooks

add-ticket-to-commit

  • Runs on: prepare-commit-msg

We use Jira for our ticket management, and our branches usually follow the feature/proj-103-short-description method. This command adds the commit message to the start of the commit.

The code is inspired on the work of Wiktor Malinowski's article "How To Prefix Your Commit Message With a Ticket Number Automatically", but with some changes to suit our programming style.

To install this, add the following to your repository's .pre-commit-config.yaml

repos:
  #
  - repo: https://github.com/motivozwolle/pre-commit-hooks
    hooks:
      - id: add-ticket-to-commit

shellcheck

  • Runs on: commit

Checks the bash scripts in the repository against shellcheck for common errors.

To install this, add the following to your repository's .pre-commit-config.yaml

repos:
  #
  - repo: https://github.com/motivozwolle/pre-commit-hooks
    hooks:
      - id: shellcheck

About

Various pre-commit hooks we found useful.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 56.3%
  • Shell 43.7%