Skip to content

Latest commit

 

History

History
57 lines (39 loc) · 1.68 KB

File metadata and controls

57 lines (39 loc) · 1.68 KB

docker-commitlint

This is a preconfigured Docker image with commitlint. It is configured for use within Extenda Retail and has the following settings

  • Extend @commitlint/config-conventional
  • Disable the scope-case rule to allow any case
  • Change the subject-case rule to sentence-case
  • Custom imperative-tense rule to check subjects for imperative mood
  • Custom 'format' rule to validate structure of PR title

🚀 Usage

This image can be used in three ways.

  1. As a standalone commitlint CLI
  2. As a pre-commit hook
  3. As a GitHub action

CLI

docker pull extenda/commitlint
echo "feat: add feature" | docker run --rm -i extenda/commitlint
docker run --rm -i extenda/commitlint --from HEAD~1

Pre-Commit Hook

The image can be used to build a pre-commit hook. Extenda provides a commitlint pre-commit hook that can be configured like this:

- repo: git@github.com:extenda/pre-commit-hooks.git
  rev: v0.4
  hooks:
    - id: commitlint
      stages: [commit-msg]

GitHub Action

To support GitHub actions, the docker image offers an alternative entrypoint under /usr/local/bin/action.

Usage: action [-c <sha>] [-m <message>] [-f <check_format>]

Extenda Retail provides a GitHub action out-of-the-box available at https://github.com/extenda/actions/commitlint.

📃 License

This project is licensed under the MIT license.

Attributions

This project contains a list imperative mood blacklist from the MIT licensed git-good-commit project.