All Projects → compilerla → conventional-pre-commit

compilerla / conventional-pre-commit

Licence: Apache-2.0 license
A pre-commit hook that checks commit messages for Conventional Commits formatting

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to conventional-pre-commit

blackbricks
Black for Databricks notebooks
Stars: ✭ 40 (-39.39%)
Mutual labels:  pre-commit, pre-commit-hook
pre-commit-dbt
🎣 List of `pre-commit` hooks to ensure the quality of your `dbt` projects.
Stars: ✭ 149 (+125.76%)
Mutual labels:  pre-commit, pre-commit-hook
ready
A program to run tasks before a commit.
Stars: ✭ 16 (-75.76%)
Mutual labels:  pre-commit, pre-commit-hook
Husky.Net
Git hooks made easy with Husky.Net internal task runner! 🐶 It brings the dev-dependency concept to the .NET world!
Stars: ✭ 394 (+496.97%)
Mutual labels:  pre-commit
commithelper
A tool to create and lint commit messages
Stars: ✭ 35 (-46.97%)
Mutual labels:  conventional-commits
pre-commit-opa
Pre-commit git hooks for Open Policy Agent (OPA) and Rego development
Stars: ✭ 53 (-19.7%)
Mutual labels:  pre-commit
template-python
Template repository for Python projects
Stars: ✭ 20 (-69.7%)
Mutual labels:  pre-commit
ocflib
Python libraries for account and server management
Stars: ✭ 13 (-80.3%)
Mutual labels:  pre-commit
pre-commit-hooks
git pre-commit hooks
Stars: ✭ 71 (+7.58%)
Mutual labels:  pre-commit
cocogitto
The Conventional Commits toolbox
Stars: ✭ 242 (+266.67%)
Mutual labels:  conventional-commits
pre-commit-mirror-maker
Scripts for creating mirror repositories that do not have .pre-commit-hooks.yaml
Stars: ✭ 19 (-71.21%)
Mutual labels:  pre-commit
pre-commit-hooks-safety
A pre-commit hook to check your Python dependencies against safety-db
Stars: ✭ 69 (+4.55%)
Mutual labels:  pre-commit
check-jsonschema
A CLI and set of pre-commit hooks for jsonschema validation with built-in support for GitHub Workflows, Renovate, Azure Pipelines, and more!
Stars: ✭ 51 (-22.73%)
Mutual labels:  pre-commit
mdsh
`$ mdsh` # a markdown shell pre-processor
Stars: ✭ 64 (-3.03%)
Mutual labels:  pre-commit-hook
slackbridge
Bridge between IRC and Slack running on Kubernetes
Stars: ✭ 12 (-81.82%)
Mutual labels:  pre-commit
pre-commit-hooks
Standardizing our code quality tooling 🛠️
Stars: ✭ 44 (-33.33%)
Mutual labels:  pre-commit
pre-commit
pre-commit hook terraform; pre-commit hook prometheus
Stars: ✭ 35 (-46.97%)
Mutual labels:  pre-commit
git-cm
Easily create conventional-commits friendly commit messages.
Stars: ✭ 76 (+15.15%)
Mutual labels:  conventional-commits
action-semantic-pull-request
A GitHub Action that ensures that your PR title matches the Conventional Commits spec.
Stars: ✭ 377 (+471.21%)
Mutual labels:  conventional-commits
turbogit
Opinionated cli enforcing clean git workflow without comprising UX
Stars: ✭ 42 (-36.36%)
Mutual labels:  conventional-commits

conventional-pre-commit

A pre-commit hook to check commit messages for Conventional Commits formatting.

Usage

Make sure pre-commit is installed.

Create a blank configuration file at the root of your repo, if needed:

touch .pre-commit-config.yaml

Add a new repo entry to your configuration file:

repos:

# - repo: ...

  - repo: https://github.com/compilerla/conventional-pre-commit
    rev: <git sha or tag>
    hooks:
      - id: conventional-pre-commit
        stages: [commit-msg]
        args: [] # optional: list of Conventional Commits types to allow

Install the pre-commit script:

pre-commit install --hook-type commit-msg

Make a (normal) commit :

$ git commit -m "add a new feature"

[INFO] Initializing environment for ....
Conventional Commit......................................................Failed
- hook id: conventional-pre-commit
- duration: 0.07s
- exit code: 1

[Commit message] add a new feature

Your commit message does not follow Conventional Commits formatting
https://www.conventionalcommits.org/

Conventional Commits start with one of the below types, followed by a colon,
followed by the commit message:

    build chore ci docs feat fix perf refactor revert style test

Example commit message adding a feature:

    feat: implement new API

Example commit message fixing an issue:

    fix: remove infinite loop

Optionally, include a scope in parentheses after the type for more context:

    fix(account): remove infinite loop

Make a (conventional) commit ✔️:

$ git commit -m "feat: add a new feature"

[INFO] Initializing environment for ....
Conventional Commit......................................................Passed
- hook id: conventional-pre-commit
- duration: 0.05s

Versioning

Versioning generally follows Semantic Versioning.

License

Apache 2.0

Inspired by matthorgan's pre-commit-conventional-commits.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].