Skip to content

Commit 342ad02

Browse files
authored
Merge pull request #911 from vansh-codes/misc/add-commit-guidelines-in-readme
docs: ✏️ Add commit guidelines & rules in contribution guide
2 parents 6063cd9 + a86486c commit 342ad02

File tree

2 files changed

+41
-2
lines changed

2 files changed

+41
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ git checkout -b feature/your-feature-name
191191
**Commit your changes:**
192192

193193
```bash
194-
git commit -m "Add: brief description of your changes"
194+
git commit
195195
```
196196

197197
**Push to your fork:**

community/contributing-guidelines.md

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,17 @@ sidebar_position: 2
77

88
## Table of Contents
99

10+
- [Table of Contents](#table-of-contents)
1011
- [Local Setup Guide](#local-setup-guide)
12+
- [How to set up recode hive:](#how-to-set-up-recode-hive)
1113
- [Environment Setup (for GitHub API access)](#environment-setup-for-github-api-access)
1214
- [Contributing to recode hive](#contributing-to-recode-hive)
15+
- [Commit Message Format](#commit-message-format)
16+
- [Example Commit Messages:](#example-commit-messages)
17+
- [Using Commitizen with Husky](#using-commitizen-with-husky)
1318
- [Formatting](#formatting)
14-
- [Branding & Naming Conventions](#branding--naming-conventions)
19+
- [Branding \& Naming Conventions](#branding--naming-conventions)
20+
- [Exceptions to Lowercase Branding](#exceptions-to-lowercase-branding)
1521
- [License](#license)
1622

1723
## Local Setup Guide
@@ -130,6 +136,39 @@ We welcome contributions! Follow these steps to get started.
130136
git add .
131137
git commit -m "Brief description of your changes"
132138
```
139+
#### Commit Message Format
140+
141+
We use [Commitizen](https://www.npmjs.com/package/commitizen) with the [git-cz](https://www.npmjs.com/package/git-cz) adapter to ensure consistent commit messages that follow a standard changelog style. This helps in generating changelogs and maintaining a clear project history.
142+
143+
Commit messages should follow this pattern:
144+
145+
```
146+
<type>: [#<GIT-ISSUE>] <subject>
147+
```
148+
- **type**: The type of change that you're committing. It should be one of the following:
149+
- **feat**: A new feature
150+
- **fix**: A bug fix
151+
- **docs**: Documentation only changes
152+
- **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
153+
- **refactor**: A code change that neither fixes a bug nor adds a feature
154+
- **perf**: A code change that improves performance
155+
- **test**: Adding missing tests or correcting existing tests
156+
- **chore**: Changes to the build process or auxiliary tools and libraries such as documentation generation
157+
- **ci**: Changes to CI configuration files and scripts
158+
159+
- **GIT-ISSUE**: The Git issue ID associated with the change.
160+
- **subject**: A brief description of the change.
161+
162+
### Example Commit Messages:
163+
164+
- `feat: [#1] Add user login functionality`
165+
- `fix: [#24] Resolve navbar alignment issue`
166+
- `chore: [#101] Update dependencies to latest versions`
167+
168+
### Using Commitizen with Husky
169+
170+
We have configured [Husky](https://www.npmjs.com/package/husky) to automatically run Commitizen when you commit changes. This is done using the `prepare-commit-msg` hook. Simply use the `git commit` command, and Commitizen will guide you through the commit message creation process.
171+
133172

134173
7. **Push Your Branch to Your Fork**
135174

0 commit comments

Comments
 (0)