Skip to content

Commit e9ecf83

Browse files
woileLee-W
authored andcommitted
docs: add faq
1 parent eef1e6d commit e9ecf83

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

docs/faq.md

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
## Support for PEP621
2+
3+
PEP621 establishes a `[project]` definition inside `pyproject.toml`
4+
5+
```toml
6+
[project]
7+
name = "spam"
8+
version = "2020.0.0"
9+
```
10+
11+
Commitizen **won't** use the `project.version` as a source of truth because it's a
12+
tool aimed for any kind of project.
13+
14+
If we were to use it, it would increase the complexity of the tool. Also why
15+
wouldn't we support other project files like `cargo.toml` or `package.json`?
16+
17+
Instead of supporting all the different project files, you can use `version_files`
18+
inside `[tool.commitizen]`, and it will cheaply keep any of these project files in sync
19+
20+
```toml
21+
[tool.commitizen]
22+
version = "2.5.1"
23+
version_files = [
24+
"pyproject.toml:^version",
25+
"cargo.toml:^version",
26+
"package.json:\"version\":"
27+
]
28+
```

mkdocs.yml

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ nav:
2121
- Writing commits: 'tutorials/writing_commits.md'
2222
- GitLab CI: 'tutorials/gitlab_ci.md'
2323
- Github Actions: 'tutorials/github_actions.md'
24+
- FAQ: 'faq.md'
2425
- Exit Codes: 'exit_codes.md'
2526
- Third-Party Commitizen Templates: 'third-party-commitizen.md'
2627
- Contributing: 'contributing.md'

0 commit comments

Comments
 (0)