From 06c1cde2ad0d07be10c04fb4cc32b99978c5cc08 Mon Sep 17 00:00:00 2001 From: nazarli-shabnam Date: Fri, 3 Apr 2026 14:57:05 +0400 Subject: [PATCH 1/3] chore: ignores array that skips merge pull reqs --- commitlint.config.cjs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/commitlint.config.cjs b/commitlint.config.cjs index 0952922..f5c5796 100644 --- a/commitlint.config.cjs +++ b/commitlint.config.cjs @@ -1,4 +1,9 @@ module.exports = { extends: ["@commitlint/config-conventional"], + ignores: [ + (message) => message.startsWith("Merge pull request "), + (message) => message.startsWith("Merge branch "), + (message) => message.startsWith("Merge remote-tracking branch "), + ], } From db963a207320913ab44734fccd41b4bf8da1b98d Mon Sep 17 00:00:00 2001 From: nazarli-shabnam Date: Fri, 3 Apr 2026 15:03:00 +0400 Subject: [PATCH 2/3] chore: docker container name --- deploy/docker-compose.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/deploy/docker-compose.yml b/deploy/docker-compose.yml index 8515cbf..47db799 100644 --- a/deploy/docker-compose.yml +++ b/deploy/docker-compose.yml @@ -1,3 +1,5 @@ +name: clevis + services: api: build: From 5bd458af98578387ac9085eaac04c152702a1311 Mon Sep 17 00:00:00 2001 From: nazarli-shabnam Date: Fri, 3 Apr 2026 15:08:07 +0400 Subject: [PATCH 3/3] chore: docs, commit set rule --- .husky/commit-msg | 5 ++++- CONTRIBUTING.md | 16 +++++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/.husky/commit-msg b/.husky/commit-msg index a110112..e5c38d2 100644 --- a/.husky/commit-msg +++ b/.husky/commit-msg @@ -1,2 +1,5 @@ #!/usr/bin/env sh -npx --no -- commitlint --edit "$1" +# Same Conventional Commit rules as CI (.github/workflows/ci.yml). On failure Git +# aborts this commit; fix the message and run git commit again. +printf '%s\n' "Commit message: checking (commitlint, verbose)…" +commitlint --verbose --edit "$1" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4d14eb7..3ee5077 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -41,13 +41,23 @@ The repo uses `.gitattributes` so text files are stored with **LF**. On Windows, ## Git hooks (Husky) -After `npm ci` at the repo root: +After `npm ci` at the **repository root**, Git uses Husky (`core.hooksPath` → `.husky/_`). Then: -- **`pre-commit`** runs `npm --prefix apps/ui run typecheck`. Ensure `apps/ui` dependencies are installed so this succeeds. -- **`commit-msg`** runs [Commitlint](https://commitlint.js.org/) with the [Conventional Commits](https://www.conventionalcommits.org/) preset (`@commitlint/config-conventional`). +- **`pre-commit`** runs before the commit is recorded. It runs `npm --prefix apps/ui run typecheck`. Install UI deps (`apps/ui/npm ci`) so this can succeed. +- **`commit-msg`** runs **immediately after** you supply a message—whether from `git commit -m "your subject"` or from the editor. It runs the same [Commitlint](https://commitlint.js.org/) rules as CI ([Conventional Commits](https://www.conventionalcommits.org/) via `@commitlint/config-conventional`), with **`--verbose`** output like the workflow. + +If Commitlint fails, **Git does not create the commit**. You will see the errors in your terminal; fix the message and run `git commit` again (no need to wait for CI to discover the problem). + +**Hooks not running?** Run `npm ci` (or `npm install`) once at the repo root. If you only install dependencies under `apps/ui`, root Husky never runs and commits will not be checked locally. To bypass hooks in exceptional cases (not recommended for routine work): `git commit --no-verify`. +**Dry-run a message without committing** (from repo root, after `npm ci`): + +```bash +printf '%s\n' 'feat(ui): example valid message' | npx --no -- commitlint --verbose +``` + ## Commit messages Use **Conventional Commits**, for example: