Skip to content

Latest commit

 

History

History
54 lines (36 loc) · 1.22 KB

README.md

File metadata and controls

54 lines (36 loc) · 1.22 KB

Mixmax's git hooks

This repository contains the git hooks for Mixmax's development workflow. We use commitlint to reduce friction when using semantic-release, and desire to tighten the feedback cycle to further reduce friction.

Install

$ npm i -D @mixmaxhq/git-hooks @commitlint/cli

Configure

The git hooks are opt-in using the global mixmax configuration file ~/.config/mixmax/config:

[git.hooks]
commit_msg = true
pre_push = true
pre_push_mode = "all" # Valid values: "all", "unpushed"

(The syntax here is TOML.)

How to use

Copy this to a .huskyrc.js file adjacent to the .git and node_modules directories of a project:

module.exports = require('@mixmaxhq/git-hooks');

// Husky explicitly greps for the hook itself to determine whether to run the hook. Here are the
// hooks, to bypass this check:
//
// - pre-push
// - commit-msg

Building

npm run build

Outputs a commonjs-compatible bundle to dist/index.js.

Running tests

npm test

Publishing

Merging to master will automatically publish the package if commits with non-trivial changes have been introduced (per commit conventions).