-
-
Notifications
You must be signed in to change notification settings - Fork 302
docs: bump documentation #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
## About | ||
|
||
The version is bumped **automatically** based on the commits. | ||
|
||
The commits should follow the rules of the commiter in order to be parsed properly. | ||
|
||
It is possible to specify a **prerelease** (alpha, beta, release candidate) version. | ||
|
||
The version can also be **manually** bumped. | ||
|
||
The version format follows [semantic versioning][semver]. | ||
|
||
This means `MAJOR.MiNOR.PATCH` | ||
|
||
| Increment | Description | Conventional commit map | | ||
| ------- | ----- | ------ | | ||
| `MAJOR` | Breaking changes introduced | `BREAKING CHANGE` | | ||
| `MINOR` | New features | `feat` | | ||
| `PATCH` | Fixes | `fix` + everything else | | ||
|
||
|
||
Prereleases are supported following python's [PEP 0440][pep440] | ||
|
||
The scheme of this format is | ||
|
||
``` | ||
[N!]N(.N)*[{a|b|rc}N][.postN][.devN] | ||
``` | ||
|
||
Some examples: | ||
|
||
``` | ||
0.9.0 | ||
0.9.1 | ||
0.9.2 | ||
0.9.10 | ||
0.9.11 | ||
1.0.0a0 # alpha | ||
1.0.0a1 | ||
1.0.0b0 # beta | ||
1.0.0rc0 # release candidate | ||
1.0.0rc1 | ||
1.0.0 | ||
1.0.1 | ||
1.1.0 | ||
2.0.0 | ||
2.0.1a | ||
``` | ||
|
||
`post` and `dev` releases are not supported yet. | ||
|
||
## Usage | ||
|
||
```bash | ||
$ cz bump --help | ||
usage: cz bump [-h] [--dry-run] [--tag-format TAG_FORMAT] | ||
[--prerelease {alpha,beta,rc}] | ||
[--increment {MAJOR,MINOR,PATCH}] | ||
|
||
optional arguments: | ||
-h, --help show this help message and exit | ||
--dry-run show output to stdout, no commit, no modified files | ||
--tag-format TAG_FORMAT | ||
format used to tag the commmit and read it, use it in | ||
existing projects, wrap around simple quotes. | ||
--prerelease {alpha,beta,rc}, -pr {alpha,beta,rc} | ||
choose type of prerelease | ||
--increment {MAJOR,MINOR,PATCH} | ||
manually specify the desired increment | ||
``` | ||
|
||
|
||
## Configuration | ||
|
||
`tag_format` | ||
|
||
Used to read the format from the git tags, and also to generate the tags. | ||
|
||
Supports 2 types of formats, a simple and a more complex. | ||
|
||
```bash | ||
cz bump --tag_format="v$version" | ||
``` | ||
|
||
```bash | ||
cz bump --tag_format="v$minor.$major.$path$prerelease" | ||
``` | ||
|
||
In your `pyproject.toml` | ||
|
||
```toml | ||
[commitizen] | ||
tag_format = "v$minor.$major.$path$prerelease" | ||
``` | ||
|
||
The variables must be preceded by a `$` sign. | ||
|
||
Suppported variables: | ||
|
||
| Variable | Description | | ||
| --- | ----------- | | ||
| `$version` | full generated version | | ||
| `$major` | MAJOR increment | | ||
| `$minor` | MINOR increment | | ||
| `$patch` | PATCH increment | | ||
| `$prerelease` | Prerelase (alpha, beta, release candidate) | | ||
|
||
`files` | ||
|
||
Used to identify the files which should be updated with the new version. | ||
In your `pyproject.toml` | ||
|
||
Commitizen will update it's configuration (`pyproject.toml`, `.cz`) when bumping. | ||
|
||
```toml | ||
[commitizen] | ||
files = [ | ||
"src/__version__.py", | ||
"setup.py" | ||
] | ||
``` | ||
|
||
[pep440]: https://www.python.org/dev/peps/pep-0440/ | ||
[semver]: https://semver.org/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Configuration | ||
|
||
**New!**: Support for `pyproject.toml` | ||
|
||
Add an entry to `pyproject.toml`. | ||
|
||
|
||
[tool.commitizen] | ||
name = "cz_conventional_commits" | ||
version = "0.1.0" | ||
files = [ | ||
"src/__version__.py", | ||
"pyproject.toml" | ||
] | ||
|
||
|
||
Also, you can create in your project folder a file called `.cz`, | ||
`.cz.cfg` or in your `setup.cfg` or if you want to configure the global | ||
default in your user's home folder a `.cz` file with the following | ||
information: | ||
|
||
[commitizen] | ||
name = cz_conventional_commits | ||
version = 0.1.0 | ||
files = [ | ||
"src/__version__.py", | ||
"pyproject.toml" | ||
] | ||
|
||
The extra tab at the end (`]`) is required. | ||
|
||
## settings | ||
|
||
| Variable | Type | Default | Description | | ||
| -------- | ---- | ------- | ----------- | | ||
| name | str | `"cz_conventional_commits"` | Name of the commiting rules to use | | ||
| version | str | `None` | Current version. Example: "0.1.2" | | ||
| files | list | `[ ]` | Files were the version needs to be updated | | ||
| tag_format | str | `None` | Format for the git tag, useful for old projects, that use a convention like `"v1.2.1"`. [See more](/bump#configuration) | |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.