Skip to content

Commit cf15666

Browse files
authored
chore(commit-template): Added a commit-template to help with commitlint syntax (#255)
* chore(commit-template): Added a commit-template to help with commitlint syntax * chore(comment): Fixed a requested comment
1 parent a2b4e5f commit cf15666

File tree

4 files changed

+112
-0
lines changed

4 files changed

+112
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
2+
3+
# <type>(<scope>): <Short description> (max 100 chars)
4+
#
5+
# [optional body]
6+
#
7+
# [optional footer(s)]
8+
#
9+
# ─────────────────────────────────────────────
10+
# Conventional Commits – Commit Message Template (Aligned with commitlint)
11+
# ─────────────────────────────────────────────
12+
#
13+
# Header (REQUIRED)
14+
# Format: <type>(<scope>): <Short description>
15+
# - <type>: one of
16+
# feat – A new feature added to the codebase.
17+
# fix – A bug fix or correction to existing functionality.
18+
# docs – Documentation changes only (no code changes).
19+
# style – Code style updates (formatting, spacing, etc.) without changing behavior.
20+
# refactor – Code restructuring without fixing a bug or adding a feature.
21+
# perf – Performance improvements in the code.
22+
# test – Adding or modifying tests without affecting production code.
23+
# chore – Maintenance tasks such as build process updates or dependency changes.
24+
# revert – Reverting a previous commit.
25+
# - <scope>: REQUIRED (e.g., ui, api, auth). Use lowercase/kebab if possible.
26+
# - <Short description>: sentence-case, start-case, or lower-case; max 100 chars; no trailing period.
27+
#
28+
# Body (OPTIONAL)
29+
# - Explain WHAT and WHY (not how).
30+
# - Must be preceded by a blank line (enforced).
31+
# - Wrap lines at ≤200 chars (config limit).
32+
#
33+
# Footer (OPTIONAL)
34+
# - Must be preceded by a blank line (enforced).
35+
# - Link issues: Closes #123, Fixes #456
36+
# - BREAKING CHANGE: <description of the breaking change and migration notes>
37+
#
38+
# Examples
39+
# feat(auth): Add OAuth2 login support
40+
# fix(api): Handle 429 rate limit with retry and jitter
41+
# docs(readme): Update Docker troubleshooting section
42+
# refactor(forms): Extract validation helpers from component
43+
# perf(search): Cache results for 5 mins to reduce TTFB

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@ docker compose up -d --build
1212
**note** Depending on local system architecture the build and launch of the angular server can
1313
take up to 60 seconds once the docker build finishes.
1414

15+
## Index
16+
17+
### Recommended
18+
19+
- Install git commit template: [Commit Template](docs/commit.template.md).
20+
21+
### Optional
22+
23+
- Admin Knowledge Base: [Admin Knowledge Base](docs/admin.knowledge-base.md).
24+
1525
## Testing the project
1626

1727
The project uses jest for unit testing.

docs/admin.knowledge-base.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Admin Knowledge Base
2+
3+
Information on updates that require admin permissions
4+
5+
## All things GitHub
6+
7+
### Updating the git template message
8+
9+
if the shared template changes in `.github/templates/commit-template.txt`, pull the latest changes from `main` and you’ll get the updated version automatically. your local git config will still point to the same file.

docs/commit.template.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
## 📝 Enabling the Shared Commit Template
2+
3+
This project includes a Git commit message template stored at:
4+
5+
```
6+
.github/templates/commit-template.txt
7+
```
8+
9+
Using a shared template helps us keep commit messages consistent and easy to read.
10+
11+
---
12+
13+
### 1. Set the Template for This Repository
14+
15+
Run the following command **inside the repository**:
16+
17+
```bash
18+
git config commit.template .github/templates/commit-template.txt
19+
```
20+
21+
This sets the template **only for this repo** (stored in `.git/config`), so it won’t affect your other projects.
22+
23+
---
24+
25+
### 2. Using the Template
26+
27+
Once configured, running:
28+
29+
```bash
30+
git commit
31+
```
32+
33+
or
34+
35+
```bash
36+
git commit -a
37+
```
38+
39+
will open your editor with the pre-filled template text.
40+
Fill in each section before saving and closing.
41+
42+
**note**
43+
44+
This command will by-pass the editor. The message will still need to follow the commitlint standard.
45+
46+
```bash
47+
git commit -am 'message'
48+
```
49+
50+
---

0 commit comments

Comments
 (0)