Skip to content

Commit b478020

Browse files
committed
docs(contributing.md): improve readability of contributing docs
1 parent 092ce4a commit b478020

File tree

1 file changed

+74
-27
lines changed

1 file changed

+74
-27
lines changed

docs/contributing.md

+74-27
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,82 @@
11
## Contributing to commitizen
22

3-
First of all, thank you for taking the time to contribute! 🎉
3+
First, thank you for taking the time to contribute! 🎉
44

55
When contributing to [commitizen](https://github.com/commitizen-tools/commitizen), please first create an [issue](https://github.com/commitizen-tools/commitizen/issues) to discuss the change you wish to make before making a change.
66

77
If you're a first-time contributor, you can check the issues with the [good first issue](https://github.com/commitizen-tools/commitizen/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) tag.
88

9-
## Install before contributing
10-
11-
1. Install [poetry](https://python-poetry.org/) `>=2.0.0`. See the installation [pages](https://python-poetry.org/docs/#installing-with-the-official-installer).
12-
2. Install [gpg](https://gnupg.org). See the installation [pages](https://gnupg.org/documentation/manuals/gnupg/Installation.html#Installation). For Mac users, you can use [homebrew](https://brew.sh/).
13-
14-
## Before making a pull request
15-
16-
1. Fork [the repository](https://github.com/commitizen-tools/commitizen).
17-
2. Clone the repository from your GitHub.
18-
3. Set up the development environment through [poetry](https://python-poetry.org/) (`poetry install`).
19-
4. Set up the [pre-commit](https://pre-commit.com/) hook (`poetry setup-pre-commit`).
20-
5. Checkout a new branch and add your modifications.
21-
6. Add test cases for all your changes.
22-
(We use [CodeCov](https://codecov.io/) to ensure our test coverage does not drop.)
23-
7. Use [commitizen](https://github.com/commitizen-tools/commitizen) to make git commits. We follow [conventional commits](https://www.conventionalcommits.org/).
24-
8. Run `poetry all` to ensure you follow the coding style and the tests pass.
25-
9. Optionally, update the `./docs/README.md` or `docs/images/cli_help` (by running `poetry doc:screenshots`).
26-
10. **Do not** update the `CHANGELOG.md`; it will be automatically created after merging to `master`.
27-
11. **Do not** update the versions in the project; they will be automatically updated.
28-
12. If your changes are about documentation, run `poetry doc` to serve documentation locally and check whether there are any warnings or errors.
29-
13. Send a [pull request](https://github.com/commitizen-tools/commitizen/pulls) 🙏
9+
## Prerequisites & Setup
10+
11+
### Required Tools
12+
13+
1. **Python Environment**
14+
- [Poetry](https://python-poetry.org/docs/#installing-with-the-official-installer) `>=2.0.0` for dependency management
15+
16+
2. **Version Control & Security**
17+
- Git
18+
- [GPG](https://gnupg.org) for commit signing
19+
- [Installation page](https://gnupg.org/documentation/manuals/gnupg/Installation.html#Installation)
20+
- For Mac users: `brew install gnupg`
21+
- For Windows users: Download from [Gpg4win](https://www.gpg4win.org/)
22+
- For Linux users: Use your distribution's package manager (e.g., `apt install gnupg` for Ubuntu)
23+
24+
### Getting Started
25+
26+
1. Fork [Commitizen](https://github.com/commitizen-tools/commitizen)
27+
2. Clone your fork:
28+
```bash
29+
git clone https://github.com/YOUR_USERNAME/commitizen.git
30+
cd commitizen
31+
```
32+
3. Add the upstream repository:
33+
```bash
34+
git remote add upstream https://github.com/commitizen-tools/commitizen.git
35+
```
36+
4. Set up the development environment:
37+
```bash
38+
poetry install
39+
```
40+
5. Set up pre-commit hooks:
41+
```bash
42+
poetry setup-pre-commit
43+
```
44+
45+
## Development Workflow
46+
47+
1. **Create a New Branch**
48+
```bash
49+
git switch -c feature/your-feature-name
50+
# or
51+
git switch -c fix/your-bug-fix
52+
```
53+
54+
2. **Make Your Changes**
55+
- Write your code
56+
- Add tests for new functionality
57+
- Update documentation if needed
58+
- Follow the existing code style
59+
60+
3. **Testing**
61+
- Run the full test suite: `poetry all`
62+
- Ensure test coverage doesn't drop (we use [CodeCov](https://codecov.io/))
63+
- For documentation changes, run `poetry doc` to check for warnings/errors
64+
65+
4. **Committing Changes**
66+
- Use commitizen to make commits (we follow [conventional commits](https://www.conventionalcommits.org/))
67+
- Example: `cz commit`
68+
69+
5. **Documentation**
70+
- Update `docs/README.md` if needed
71+
- For CLI help screenshots: `poetry doc:screenshots`
72+
- **DO NOT** update `CHANGELOG.md` (automatically generated)
73+
- **DO NOT** update version numbers (automatically handled)
74+
75+
6. **Pull Request**
76+
- Push your changes: `git push origin your-branch-name`
77+
- Create a pull request on GitHub
78+
- Ensure CI checks pass
79+
- Wait for review and address any feedback
3080

3181
## Use of GitHub Labels
3282

@@ -57,7 +107,7 @@ If you're a first-time contributor, you can check the issues with the [good firs
57107
* os: macOS
58108

59109

60-
### Issue life cycle
110+
## Issue life cycle
61111

62112
```mermaid
63113
graph TD
@@ -75,7 +125,7 @@ graph TD
75125
close --> output[/close/]
76126
```
77127

78-
### Pull request life cycle
128+
## Pull request life cycle
79129

80130
```mermaid
81131
flowchart TD
@@ -103,6 +153,3 @@ flowchart TD
103153
--modification-received-->
104154
review
105155
```
106-
107-
108-
[conventional-commits]: https://www.conventionalcommits.org/

0 commit comments

Comments
 (0)