diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 066e559..d65d917 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -32,10 +32,11 @@ repos: hooks: - id: codespell - repo: https://github.com/commit-check/commit-check - rev: v0.8.5 + rev: v0.9.1 hooks: - id: check-message # - id: check-branch # uncomment if you need. - # - id: check-author-name # uncomment if you need. - # - id: check-author-email # uncomment if you need. + - id: check-author-name # uncomment if you need. + - id: check-author-email # uncomment if you need. # - id: commit-signoff # uncomment if you need. + # - id: check-merge-base # uncomment if you need. diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index 0ba4a51..1fca51a 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -1,6 +1,6 @@ - id: check-message name: check commit message - description: requiring commit message to match regex + description: ensures commit message to match regex entry: commit-check args: [--message] pass_filenames: true @@ -8,29 +8,36 @@ stages: [commit-msg, prepare-commit-msg] - id: check-branch name: check branch naming - description: requiring branch naming to match regex + description: ensures branch naming to match regex entry: commit-check args: [--branch] pass_filenames: false language: python - id: check-author-name name: check committer name - description: requiring committer name to match regex + description: ensures committer name to match regex entry: commit-check args: [--author-name] pass_filenames: false language: python - id: check-author-email name: check committer email - description: requiring committer email to match regex + description: ensures committer email to match regex entry: commit-check args: [--author-email] pass_filenames: false language: python - id: check-commit-signoff name: check committer signoff - description: requiring committer to add a Signed-off-by trailer + description: ensures committer to add a Signed-off-by trailer entry: commit-check args: [--commit-signoff] pass_filenames: false language: python +- id: check-merge-base + name: check merge base + description: ensures current branch is rebased onto target branch + entry: commit-check + args: [--merge-base] + pass_filenames: false + language: python diff --git a/README.rst b/README.rst index ff9c7e6..09d71eb 100644 --- a/README.rst +++ b/README.rst @@ -32,7 +32,7 @@ Overview **Commit Check** is a free, powerful tool that enforces commit metadata standards, including commit message, branch naming, committer name/email, and commit signoff. Fully customizable with error messages and suggested commands, it ensures compliance across teams. -As an alternative to GitHub Enerprise `Metadata restrictions `_ and Bitbucket's paid puglin `Yet Another Commit Checker `_, Commit Check stands out by integrating DevOps principles and Infrastructure as Code (IaC). +As an alternative to GitHub Enterprise `Metadata restrictions `_ and Bitbucket's paid puglin `Yet Another Commit Checker `_, Commit Check stands out by integrating DevOps principles and Infrastructure as Code (IaC). Configuration ------------- @@ -75,6 +75,7 @@ Running as pre-commit hook - id: check-author-name - id: check-author-email - id: check-commit-signoff + - id: check-merge-base Running as CLI ~~~~~~~~~~~~~~ @@ -107,7 +108,7 @@ To configure the hook, create a script file in the ``.git/hooks/`` directory. .. code-block:: bash #!/bin/sh - commit-check --message --branch --author-name --author-email + commit-check --message --branch --author-name --author-email --commit-signoff --merge-base Save the script file as ``pre-push`` and make it executable: