Skip to content

Commit 573accd

Browse files
fix: add commit message guidelines
1 parent f349217 commit 573accd

File tree

3 files changed

+82
-2
lines changed

3 files changed

+82
-2
lines changed

COMMIT_MESSAGE.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Commit Messages
2+
3+
Commit messages are a crucial aspect of version control and collaboration in software development. Well-structured commit messages enhance codebase maintainability and collaboration among team members. This document provides guidelines for writing clear and concise commit messages.
4+
5+
## General Principles
6+
7+
- Each commit message should have a clear and specific purpose.
8+
- Use the present tense ("Add feature" rather than "Added feature").
9+
- Keep commit messages concise and to the point.
10+
11+
## Structure of a Commit Message
12+
13+
A commit message typically consists of three parts:
14+
15+
1. **Header:** This is a one-line summary of the commit.
16+
17+
2. **Body (optional):** Provides more detailed information about the changes made. Not all commits require a body.
18+
19+
3. **Footer (optional):** Contains any metadata related to the commit, such as issue tracker references.
20+
21+
Here's a template for structuring commit messages:
22+
```markdown
23+
<type>: <subject>
24+
<body (optional)>
25+
<footer (optional)>
26+
```
27+
28+
## Type
29+
30+
The `<type>` should describe the purpose or category of the commit. Common types include:
31+
32+
- `feat`: A new feature added to the codebase.
33+
- `fix`: A bug fix.
34+
- `docs`: Documentation-related changes.
35+
- `style`: Code style and formatting changes (no functional code changes).
36+
- `refactor`: Code refactoring without adding new features or fixing bugs.
37+
- `test`: Adding or modifying tests.
38+
- `chore`: Routine tasks, maintenance, or tooling changes.
39+
40+
## Subject
41+
42+
The `<subject>` is a concise description of the commit. It should be clear and specific. Begin with a capital letter and do not end with a period.
43+
44+
Examples:
45+
46+
- `feat: Add user registration endpoint`
47+
- `fix: Resolve issue with login validation`
48+
- `docs: Update installation guide`
49+
50+
## Body
51+
52+
The `<body>` provides more detailed information about the changes made in the commit. It is optional but recommended for complex changes or when additional context is necessary.
53+
54+
## Footer
55+
56+
The `<footer>` can include metadata, such as references to issue trackers, and should be used sparingly.
57+
58+
## Examples
59+
- **New Feature**
60+
```shell
61+
### feat: Implement chat functionality
62+
This commit adds the ability for users to send and receive chat messages in real-time. It includes both server and client-side code, as well as necessary database schema changes. A WebSocket-based communication system has been integrated to achieve this.
63+
```
64+
65+
- **Bug Fix**
66+
```shell
67+
### fix: Resolve CSS alignment issue on the homepage
68+
The homepage had a problem with elements not aligning properly on smaller screens. This commit fixes the issue by adjusting the CSS rules for responsive design, ensuring that the page displays correctly on all devices.
69+
```
70+
71+
## Additional Tips
72+
73+
- Use imperative mood in the subject. Start with a verb (e.g., "Add," "Fix," "Update") to describe what the commit does.
74+
75+
- Keep commits small and focused on a single task or logical change.
76+
77+
- Reference related issues, pull requests, or other relevant information in the commit message body or footer.
78+
79+
## References
80+
- [**Conventional Commits 1.0.0**](https://www.conventionalcommits.org/en/v1.0.0/)

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Here are some ways you can contribute to the project:
1818
2. **Clone** the forked repository to your local machine.
1919
3. Create a new **branch** for your feature/fix: `git checkout -b feature-name`.
2020
4. **Make changes** and **test** to ensure they work as expected.
21-
5. **Commit** your changes: `git commit -m 'Your descriptive commit message'`.
21+
5. **Commit** your changes: `git commit -m 'Your descriptive commit message'` . check [commit message guidelines](./COMMIT_MESSAGE.md).
2222
6. **Push** your branch to your GitHub repository: `git push origin feature-name`.
2323
7. Create a **Pull Request (PR)** from your branch to the original repository's `main` or `master` branch.
2424

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)