Skip to content

Commit 7b4c8d6

Browse files
authored
Merge branch 'master' into add-commit-rule-doc
2 parents 7e6dd11 + 0497ef2 commit 7b4c8d6

File tree

10 files changed

+335
-104
lines changed

10 files changed

+335
-104
lines changed

.github/pull_request_template.md

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,19 @@ Please fill in the following content to let us know better about this change.
99

1010
## Checklist
1111

12-
- [ ] I have read the [contributing guidelines](https://commitizen-tools.github.io/commitizen/contributing/)
12+
- [ ] I have read the [contributing guidelines](https://commitizen-tools.github.io/commitizen/contributing/contributing)
13+
14+
### Was generative AI tooling used to co-author this PR?
15+
16+
<!--
17+
If generative AI tooling has been used in the process of authoring this PR, please change below checkbox to `[X]` followed by the name of the tool, uncomment the "Generated-by".
18+
-->
19+
20+
- [ ] Yes (please specify the tool below)
21+
22+
<!--
23+
Generated-by: [Tool Name] following [the guidelines](http://commitizen-tools.github.io/commitizen/contributing/pull_request/#ai-assisted-contributions)
24+
-->
1325

1426
### Code Changes
1527

@@ -23,25 +35,31 @@ Please fill in the following content to let us know better about this change.
2335
- [ ] Update the documentation for the changes
2436

2537
### Documentation Changes
38+
<!-- You can skip this section if you are not making any documentation changes -->
39+
2640

2741
- [ ] Run `uv run poe doc` locally to ensure the documentation pages renders correctly
28-
- [ ] Check and fix any broken links (internal or external) in the documentation
42+
- [ ] Check and fix any broken links (internal or external)
2943

30-
> When running `uv run poe doc`, any broken internal documentation links will be reported in the console output like this:
31-
>
32-
> ```text
33-
> INFO - Doc file 'config.md' contains a link 'commands/bump.md#-post_bump_hooks', but the doc 'commands/bump.md' does not contain an anchor '#-post_bump_hooks'.
34-
> ```
44+
<!--
45+
When running `uv run poe doc`, any broken internal documentation links will be reported in the console output like this:
46+
47+
```text
48+
INFO - Doc file 'config.md' contains a link 'commands/bump.md#-post_bump_hooks', but the doc 'commands/bump.md' does not contain an anchor '#-post_bump_hooks'.
49+
```
50+
-->
3551

3652
## Expected Behavior
3753
<!-- A clear and concise description of what you expected to happen -->
3854

3955

4056
## Steps to Test This Pull Request
41-
<!-- Steps to reproduce the behavior:
57+
<!--
58+
Steps to reproduce the behavior:
4259
1. ...
4360
2. ...
44-
3. ... -->
61+
3. ...
62+
-->
4563

4664

4765
## Additional Context

docs/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,11 @@ After installation, you can verify the completion is working by:
303303
304304
For more detailed information about argcomplete configuration and troubleshooting, visit the [argcomplete documentation](https://kislyuk.github.io/argcomplete/).
305305
306+
## Star History
307+
308+
[![Star History Chart](https://api.star-history.com/svg?repos=commitizen-tools/commitizen)](https://star-history.com/#commitizen-tools/commitizen)
309+
310+
306311
## Sponsors
307312
308313
These are our cool sponsors!

docs/commands/changelog.md

Lines changed: 37 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## About
22

3-
This command will generate a changelog following the committing rules established.
3+
Generates a changelog following the committing rules established.
44

55
!!! tip
66
To create the changelog automatically on bump, add the setting [update_changelog_on_bump](../config/bump.md#update_changelog_on_bump)
@@ -20,7 +20,7 @@ This command will generate a changelog following the committing rules establishe
2020
# Generate full changelog
2121
cz changelog
2222

23-
# or use the alias
23+
# Or use the alias
2424
cz ch
2525

2626
# Get the changelog for the given version
@@ -30,7 +30,7 @@ cz changelog 0.3.0 --dry-run
3030
cz changelog 0.3.0..0.4.0 --dry-run
3131
```
3232

33-
## Constrains
33+
## Constraints
3434

3535
Changelog generation is constrained only to **markdown** files.
3636

@@ -46,68 +46,68 @@ These are the variables used by the changelog generator.
4646
- **<scope>**: <message>
4747
```
4848

49-
It will create a full block like above per version found in the tags.
50-
And it will create a list of the commits found.
51-
The `change_type` and the `scope` are optional, they don't need to be provided,
52-
but if your regex does, they will be rendered.
49+
Creates a full block like above per version found in the tags, and a list of the commits found.
50+
The `change_type` and `scope` are optional and don't need to be provided,
51+
but if your regex parses them, they will be rendered.
5352

54-
The format followed by the changelog is the one from [keep a changelog][keepachangelog]
53+
The format followed by the changelog is from [keep a changelog][keepachangelog]
5554
and the following variables are expected:
5655

5756
| Variable | Description | Source |
5857
| ------------- | ---------------------------------------------------------------------------------------------- | -------------- |
5958
| `version` | Version number which should follow [semver][semver] | `tags` |
60-
| `date` | Date in which the tag was created | `tags` |
59+
| `date` | Date when the tag was created | `tags` |
6160
| `change_type` | The group where the commit belongs to, this is optional. Example: fix | `commit regex` |
62-
| `message`\* | Information extracted from the commit message | `commit regex` |
61+
| `message` | Information extracted from the commit message | `commit regex` |
6362
| `scope` | Contextual information. Should be parsed using the regex from the message, it will be **bold** | `commit regex` |
64-
| `breaking` | Whether is a breaking change or not | `commit regex` |
63+
| `breaking` | Whether it is a breaking change or not | `commit regex` |
6564

66-
- **required**: is the only one required to be parsed by the regex
65+
!!! note
66+
`message` is the only variable required to be parsed by the regex.
6767

6868
## Command line options
6969

7070
### `--extras`
7171

72-
Provides your own changelog extra variables by using the `extras` settings or the `--extra/-e` parameter.
72+
Provide your own changelog extra variables by using the `extras` settings or the `--extra/-e` parameter.
7373

7474
```bash
7575
cz changelog --extra key=value -e short="quoted value"
7676
```
7777

7878
### `--file-name`
7979

80-
This value can be updated in the configuration file with the key `changelog_file` under `tools.commitizen`
80+
This value can be updated in the configuration file with the key `changelog_file` under `tool.commitizen`.
8181

82-
Specify the name of the output file, remember that changelog only works with Markdown.
82+
Specify the name of the output file. Note that changelog generation only works with Markdown files.
8383

8484
```bash
8585
cz changelog --file-name="CHANGES.md"
8686
```
8787

8888
### `--incremental`
8989

90-
This flag can be set in the configuration file with the key `changelog_incremental` under `tools.commitizen`
90+
This flag can be set in the configuration file with the key `changelog_incremental` under `tool.commitizen`
9191

9292
Benefits:
9393

94-
- Build from the latest version found in changelog, this is useful if you have a different changelog and want to use commitizen
94+
- Build from the latest version found in changelog. This is useful if you have an existing changelog and want to use commitizen to extend it.
9595
- Update unreleased area
96-
- Allows users to manually touch the changelog without being rewritten.
96+
- Allows users to manually edit the changelog without it being completely rewritten.
9797

9898
```bash
9999
cz changelog --incremental
100100
```
101101

102102
```toml
103-
[tools.commitizen]
103+
[tool.commitizen]
104104
# ...
105105
changelog_incremental = true
106106
```
107107

108108
### `--start-rev`
109109

110-
This value can be set in the configuration file with the key `changelog_start_rev` under `tools.commitizen`
110+
This value can be set in the configuration file with the key `changelog_start_rev` under `tool.commitizen`
111111

112112
Start from a given git rev to generate the changelog. Commits before that rev will not be considered. This is especially useful for long-running projects adopting conventional commits, where old commit messages might fail to be parsed for changelog generation.
113113

@@ -116,56 +116,55 @@ cz changelog --start-rev="v0.2.0"
116116
```
117117

118118
```toml
119-
[tools.commitizen]
119+
[tool.commitizen]
120120
# ...
121121
changelog_start_rev = "v0.2.0"
122122
```
123123

124124
### `--merge-prerelease`
125125

126-
This flag can be set in the configuration file with the key `changelog_merge_prerelease` under `tools.commitizen`
126+
This flag can be set in the configuration file with the key `changelog_merge_prerelease` under `tool.commitizen`
127127

128-
Collects changes from prereleases into the next non-prerelease. This means that if you have a prerelease version, and then a normal release, the changelog will show the prerelease changes as part of the changes of the normal release. If not set, it will include prereleases in the changelog.
128+
Collects changes from prereleases into the next non-prerelease version. If you have a prerelease version followed by a normal release, the changelog will show the prerelease changes as part of the normal release. If not set, prereleases will be included as separate entries in the changelog.
129129

130130
```bash
131131
cz changelog --merge-prerelease
132132
```
133133

134134
```toml
135-
[tools.commitizen]
135+
[tool.commitizen]
136136
# ...
137137
changelog_merge_prerelease = true
138138
```
139139

140140
### `--template`
141141

142-
Provides your own changelog jinja template by using the `template` settings or the `--template` parameter.
142+
Provide your own changelog Jinja template by using the `template` settings or the `--template` parameter.
143+
144+
```bash
145+
cz changelog --template="path/to/template.j2"
146+
```
143147

144148
### `--unreleased-version`
145149

146-
There is usually a chicken and egg situation when automatically
147-
bumping the version and creating the changelog.
148-
If you bump the version first, you have no changelog, you have to
149-
create it later, and it won't be included in
150-
the release of the created version.
150+
There is usually a chicken-and-egg situation when automatically bumping the version and creating the changelog:
151151

152-
If you create the changelog before bumping the version, then you
153-
usually don't have the latest tag, and the _Unreleased_ title appears.
152+
- If you bump the version first, you have no changelog yet, and it won't be included in the release of the created version.
153+
- If you create the changelog before bumping the version, you usually don't have the latest tag, and the _Unreleased_ title appears.
154154

155-
By introducing `--unreleased-version` you can prevent this situation.
155+
By using `--unreleased-version`, you can prevent this situation.
156156

157157
Before bumping you can run:
158158

159159
```bash
160160
cz changelog --unreleased-version="v1.0.0"
161161
```
162162

163-
Remember to use the tag instead of the raw version number
163+
Remember to use the tag format instead of the raw version number.
164164

165-
For example if the format of your tag includes a `v` (`v1.0.0`), then you should use that,
166-
if your tag is the same as the raw version, then ignore this.
165+
For example, if your tag format includes a `v` prefix (e.g., `v1.0.0`), use that format. If your tag is the same as the raw version (e.g., `1.0.0`), use the raw version.
167166

168-
Alternatively you can directly bump the version and create the changelog by doing
167+
Alternatively, you can directly bump the version and create the changelog by running:
169168

170169
```bash
171170
cz bump --changelog
@@ -175,7 +174,7 @@ cz bump --changelog
175174

176175
Supported hook methods:
177176

178-
- Per parsed message: Useful to add links
177+
- Per parsed message: Useful to add links to commits or issues
179178
- End of changelog generation: Useful to send Slack or chat messages, or notify another department
180179

181180
Read more about hooks in the [customization page][customization]
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
## Contributing to Commitizen
1+
# Contributing to Commitizen
22

33
First, thank you for taking the time to contribute! 🎉 Your contributions help make Commitizen better for everyone.
44

55
When contributing to Commitizen, we encourage you to:
66

7-
1. First, check out the [issues](https://github.com/commitizen-tools/commitizen/issues) and [Features we won't add](features_wont_add.md) to see if there's already a discussion about the change you wish to make.
7+
1. First, check out the [issues](https://github.com/commitizen-tools/commitizen/issues) and [Features we won't add](../features_wont_add.md) to see if there's already a discussion about the change you wish to make.
88
2. If there's no discussion, [create an issue](https://github.com/commitizen-tools/commitizen/issues/new) to discuss your proposed changes.
99
3. Follow our [development workflow](#development-workflow) and guidelines below.
1010

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Contributing TL;DR
2+
13
Feel free to send a PR to update this file if you find anything useful. 🙇
24

35
## Environment

docs/contributing/pull_request.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Pull Request Guidelines
2+
3+
This document outlines important guidelines to follow when creating a pull request.
4+
5+
## Before Creating a Pull Request
6+
7+
1. **Check Existing Issues**: Ensure there's a related issue or discussion for your changes. If not, create one first to discuss the proposed changes.
8+
2. **Follow the Development Workflow**: Make sure you've followed all steps in the [contributing guidelines](contributing.md).
9+
10+
## Making Changes
11+
12+
When adding new code, match the existing coding style in the file you're modifying. Consistency within a file and throughout the project is crucial for maintainability.
13+
14+
## Following PR Description Template Instructions
15+
16+
The PR description template includes a checklist and specific requirements. Please:
17+
18+
1. **Complete the Checklist**: Check off all applicable items before requesting review.
19+
2. **Provide Clear Descriptions**: Clearly describe what the change does, expected behavior, and steps to test.
20+
3. **Respond to Feedback**: Carefully read maintainer feedback and address all points raised. Ask for clarification if something is unclear.
21+
22+
## AI-Assisted Contributions
23+
24+
We welcome contributions that use AI tools for assistance, but we have strict quality standards to maintain code quality and avoid "AI spaghetti code."
25+
26+
!!! note
27+
Most of our new documentation changes are, of course, generated by AI, but we still need to review it and make sure it's correct.
28+
29+
![when bro's code is filled with "🔥 🚀 💥 ❌ ✅"](https://images3.memedroid.com/images/UPLOADED78/69501f1c23cab.webp)
30+
31+
### Guidelines for AI-Assisted PRs
32+
33+
1. **Review and Refine**: Thoroughly review and understand all AI-generated code. Refactor to match our project's style and remove unnecessary complexity.
34+
2. **Test Thoroughly**: Don't assume AI-generated code works—test it extensively with comprehensive test cases and manual testing when possible.
35+
3. **Understand the Code**: You should be able to explain every line. If you don't understand something, learn about it or rewrite it. Maintainers may ask you to explain your code.
36+
4. **Avoid Common Pitfalls**:
37+
- Over-engineering (simplify when possible)
38+
- Inconsistent style (ensure consistency with our standards)
39+
- Unnecessary dependencies
40+
- Copy-paste without adaptation
41+
- Verbose or obvious comments
42+
5. **Code Quality Still Matters**: AI assistance doesn't excuse poor code quality. All code must pass linting, type checking, and follow best practices.
43+
6. **Be Transparent**: **Mention AI assistance in the PR description**. Code quality standards remain the same regardless of how the code was written.
44+
45+
!!! warning "Consequences of Poor AI-Assisted Contributions"
46+
Maintainers who identify low-quality AI-generated code or copy-pasted responses will have no choice but to close the related PRs. This adds unnecessary burden on maintainers and doesn't help the project. Additionally, the contributor's reputation is impacted as maintainers may lose confidence and might restrict the user from making further contributions.
47+
48+
### What We Consider "AI Spaghetti"
49+
50+
Red flags that may result in PR rejection or requests for significant refactoring:
51+
52+
- Overly complex solutions when simpler ones exist
53+
- Unnecessary abstractions or design patterns
54+
- Code that's difficult to understand or maintain
55+
- Missing or inadequate tests
56+
- Copy-pasted code blocks that don't fit the project structure
57+
- Excessive comments explaining obvious things
58+
59+
**Remember**: If you use AI tools, you're still responsible for the quality of the final code. Use AI as a starting point, not a final solution.
60+
61+
## Commenting on the PR
62+
63+
When commenting on the PR:
64+
65+
- Address the feedback points raised by maintainers
66+
- Ask questions if something is unclear
67+
- **Do not** just copy-paste AI-generated responses
68+
- Maintainers want to see your thought process and understanding of the codebase
69+
- Maintainers and other contributors can tell if you're just copying and pasting AI-generated responses
70+
71+
Thank you for helping make Commitizen better! 🎉

0 commit comments

Comments
 (0)