-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathgit-commit-standards.mdc
More file actions
43 lines (35 loc) · 1.46 KB
/
git-commit-standards.mdc
File metadata and controls
43 lines (35 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
---
description: Enforce structured Git commit messages.
globs: .git/*
---
# Git Commit Standards
Ensures consistent Git commit messages.
## Rule Details
- **Name:** git_commit_standards
- **Description:** Enforce structured Git commit messages.
## Filters
- file extension pattern: `\\.git/.*`
## Enforcement Checks
- Conditions:
- pattern `^(?!fix|feat|perf|docs|style|refactor|test|chore): ` – Use a commit message prefix followed by colon and space (fix:, feat:, etc.).
- More precise regex to ensure prefix is followed by colon and space
- pattern `^(fix|feat|perf|docs|style|refactor|test|chore): [A-Z]` – First word after prefix should be lowercase.
- Check for uppercase after the prefix
- pattern `^(fix|feat|perf|docs|style|refactor|test|chore): .{46,}` – Keep commit message content (excluding prefix) under 46 characters.
- More precise length check that excludes the prefix from the count
- pattern `^(fix|feat|perf|docs|style|refactor|test|chore):(?! )` – Include a space after the colon in prefix.
- Ensure there's a space after the colon
## Suggestions
- Guidance:
Recommended commit format:
- "fix: resolved bug in user authentication"
- "feat: added new search functionality"
- "docs: updated installation guide"
- "style: fixed button alignment"
- "refactor: simplified login logic"
- "test: added unit tests for auth"
- "chore: updated dependencies"
- "perf: optimized database queries"
## Metadata
- Priority: high
- Version: 1.2