From d9219b3863a3d6ea5f29ff42160c0565bff8a555 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nerijus=20Bend=C5=BEi=C5=ABnas?= Date: Sun, 26 Apr 2026 08:21:31 +0300 Subject: [PATCH] docs: add GitHub Pages landing site MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Single self-contained HTML page served from docs/ on main. Pico CSS v2, Prism.js, CDN with SRI hashes, sticky nav with icons, typewriter hero, install tabs, copy buttons, mobile-responsive, prefers-reduced-motion support, JS-off static fallback. Signed-off-by: Nerijus Bendžiūnas --- docs/commit-guard-icon.svg | 49 +++ docs/index.html | 612 +++++++++++++++++++++++++++++++++++++ 2 files changed, 661 insertions(+) create mode 100644 docs/commit-guard-icon.svg create mode 100644 docs/index.html diff --git a/docs/commit-guard-icon.svg b/docs/commit-guard-icon.svg new file mode 100644 index 0000000..678d14b --- /dev/null +++ b/docs/commit-guard-icon.svg @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..00d6c29 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,612 @@ + + + + + + + commit-guard + + + + + + + + +
+ commit-guard + +
+ +
+
+

commit-guard

+

Conventional commit linting with imperative mood detection.

+
+
$ commit-guard --range origin/main..HEAD
+abc1234 feat: add user authentication
+   all checks passed
+def5678 wip: still working
+   [subject] unknown type: wip
+   [body] missing body
+
+
+ + + +
+
+ +
+

Install #

+
+
+ + + +
+ uv tool install git-commit-guard + + +
+

Or via pre-commit.

+
+ +
+

Quick start #

+
# check HEAD
+$ commit-guard
+
+# check a specific commit
+$ commit-guard abc1234
+
+# check all commits in a PR range
+$ commit-guard --range origin/main..HEAD
+
+# read from a file (for git hooks)
+$ commit-guard --message-file .git/COMMIT_EDITMSG
+ +

Checks

+

+ All checks run by default. Enable or disable individually with + --enable / --disable: +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CheckWhat it verifies
subject + Format matches type(scope): description, valid + type, lowercase start, no trailing period, max 72 chars +
imperative + First word is an imperative verb — uses NLP, not just a regex +
bodyBody is present after a blank line
signed-offSigned-off-by: trailer is present
signatureGPG or SSH signature is valid
+
+
+ +
+

Configuration #

+

+ Place .commit-guard.toml in your project root. CLI flags + always take precedence over the config file. +

+
# .commit-guard.toml
+disable = ["signature", "body"]
+scopes = ["auth", "api", "db"]
+require-scope = true
+types = ["feat", "fix", "chore", "wip"]
+max-subject-length = 100
+min-description-length = 10
+require-trailers = ["Closes", "Reviewed-by"]
+
+ +
+

GitHub Actions #

+

Check all commits in a pull request:

+
jobs:
+  lint-commits:
+    runs-on: ubuntu-latest
+    env:
+      PR_BASE: ${{ github.event.pull_request.base.sha }}
+      PR_HEAD: ${{ github.event.pull_request.head.sha }}
+    steps:
+      - uses: actions/checkout@v4
+        with:
+          fetch-depth: 0
+      - uses: benner/commit-guard@v0.14.1
+        with:
+          range: ${{ env.PR_BASE }}..${{ env.PR_HEAD }}
+          disable: signed-off,signature
+ +

+ All inputs mirror the CLI flags: enable, + disable, scopes, require-scope, + types, max-subject-length, + min-description-length, require-trailer, + output-file. +

+
+ +
+

pre-commit #

+

Add to .pre-commit-config.yaml:

+
repos:
+  - repo: https://github.com/benner/commit-guard
+    rev: v0.14.1
+    hooks:
+      - id: commit-guard
+      - id: commit-guard-signature
+
+
+ + + + + + + + + +