Commit
Create a git commit for staged and unstaged changes.
Commit message format
This project uses commitlint with @commitlint/config-conventional, enforced by a lefthook commit-msg hook.
Rules:
- Format:
<type>: <subject>(no scope required) - Subject: max 50 characters total (including
type:prefix), lowercase, no trailing period - Body (optional): wrap at 72 characters, separated from subject by a blank line
Choosing the right commit type
This project uses semantic-release. Some types trigger a release (new version published to users), others do not. Choose carefully — a wrong type means an unnecessary release.
Release-triggering types — only use when the change is meaningful to end users:
feat:→ minor release — a new user-facing featurefix:→ patch release — a bug fix that affects user behaviorperf:→ patch release — a performance improvement users would noticerefactor:→ patch release — use only if it changes observable behavior; otherwise usechore:revert:→ patch release — reverting a user-facing change
Non-release types — use for everything else:
chore:→ no release — tooling, CI, dependencies, config, internal cleanupdocs:→ no release — documentation changesstyle:→ no release — formatting, whitespace, linting fixestest:→ no release — adding or fixing testsci:→ no release — CI/CD pipeline changesbuild:→ no release — build system changes
Rule of thumb: if the change doesn't affect what end users experience when running the integration, it should NOT trigger a release. Use chore:, docs:, style:, test:, ci:, or build: instead.
Examples:
- Fixing lefthook config →
chore:(notfix:— this is internal tooling) - Updating internal doc references →
docs:(notfix:) - Optimizing CI/hook parallelism →
chore:(notperf:— users don't see this) - Fixing a bug in device discovery →
fix:(users are affected) - Adding a new sensor entity →
feat:(users get new functionality)
Steps
- Run
git statusandgit diffto review all changes - Run
git log --oneline -5to match the existing commit style - Draft a commit message following the rules above — count characters to ensure the subject line fits within 50
- Stage relevant files by name (avoid
git add -A) - Commit with the message using a HEREDOC
- If the commit-msg hook fails, fix the message and create a new commit (do not amend)