Skip to content

Latest commit

 

History

History
54 lines (42 loc) · 1.2 KB

pre-commit.md

File metadata and controls

54 lines (42 loc) · 1.2 KB

Pre-commit hook

You can add CommitMe as a pre-commit by:

  1. Installing pre-commit
  2. Including CommitMe in your .pre-commit.config.yaml file, e.g.:
repos:
- repo: https://github.com/dev-build-deploy/commit-me
  rev: v0.12.0
  hooks:
  - id: commit-me
  1. Installing the commit-msg hooks
$ pre-commit install --hook-type commit-msg 

Configuration

The Pre-Commit hook will run the ./bin/pre-commit-me executable:

Usage: pre-commit-me [options] <file>

Conventional Commit message validation (pre-commit hook)

Arguments:
  file                 The file containing the commit messages to validate.

Options:
  -c, --config <file>  The configuration file to use.
  -h, --help           display help for command

Therefor, you can use the args keyword to specify a list of options, for example:

repos:
- repo: https://github.com/dev-build-deploy/commit-me
  rev: v0.13.1
  hooks:
  - id: commit-me
    args: [
      # Specify a custom configuration file path
      '--config', '.github/.commit-me.json'
    ]