Skip to content

Commit f80292e

Browse files
bearomorphismLee-W
authored andcommitted
docs(customization.md): fix grammar mistake, add title to code blocks
1 parent db94c4d commit f80292e

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

docs/customization.md

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The basic steps are:
1010

1111
Example:
1212

13-
```toml
13+
```toml title="pyproject.toml"
1414
[tool.commitizen]
1515
name = "cz_customize"
1616

@@ -50,7 +50,7 @@ message = "Do you want to add body message in commit?"
5050

5151
The equivalent example for a json config file:
5252

53-
```json
53+
```json title=".cz.json"
5454
{
5555
"commitizen": {
5656
"name": "cz_customize",
@@ -106,7 +106,7 @@ The equivalent example for a json config file:
106106

107107
And the correspondent example for a yaml file:
108108

109-
```yaml
109+
```yaml title=".cz.yaml"
110110
commitizen:
111111
name: cz_customize
112112
customize:
@@ -149,16 +149,16 @@ commitizen:
149149
150150
| Parameter | Type | Default | Description |
151151
| ------------------- | ------ | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
152-
| `questions` | `Questions` | `None` | Questions regarding the commit message. Detailed below. The type `Questions` is an alias to `Iterable[MutableMapping[str, Any]]` which is defined in `commitizen.defaults`. It expects a list of dictionaries. |
152+
| `questions` | `Questions` | `None` | Questions regarding the commit message. Detailed below. The type `Questions` is an alias to `Iterable[MutableMapping[str, Any]]` which is defined in `commitizen.defaults`. It expects a list of dictionaries. |
153153
| `message_template` | `str` | `None` | The template for generating message from the given answers. `message_template` should either follow [Jinja2][jinja2] formatting specification, and all the variables in this template should be defined in `name` in `questions` |
154-
| `example` | `str` | `""` | (OPTIONAL) Provide an example to help understand the style. Used by `cz example`. |
155-
| `schema` | `str` | `""` | (OPTIONAL) Show the schema used. Used by `cz schema`. |
156-
| `schema_pattern` | `str` | `""` | (OPTIONAL) The regular expression used to do commit message validation. Used by `cz check`. |
157-
| `info_path` | `str` | `""` | (OPTIONAL) The path to the file that contains explanation of the commit rules. Used by `cz info`. If not provided `cz info`, will load `info` instead. |
158-
| `info` | `str` | `""` | (OPTIONAL) Explanation of the commit rules. Used by `cz info`. |
154+
| `example` | `str` | `""` | (OPTIONAL) Provide an example to help understand the style. Used by `cz example`. |
155+
| `schema` | `str` | `""` | (OPTIONAL) Show the schema used. Used by `cz schema`. |
156+
| `schema_pattern` | `str` | `""` | (OPTIONAL) The regular expression used to do commit message validation. Used by `cz check`. |
157+
| `info_path` | `str` | `""` | (OPTIONAL) The path to the file that contains explanation of the commit rules. Used by `cz info`. If not provided `cz info`, will load `info` instead. |
158+
| `info` | `str` | `""` | (OPTIONAL) Explanation of the commit rules. Used by `cz info`. |
159159
| `bump_map` | `dict` | `None` | (OPTIONAL) Dictionary mapping the extracted information to a `SemVer` increment type (`MAJOR`, `MINOR`, `PATCH`) |
160160
| `bump_pattern` | `str` | `None` | (OPTIONAL) Regex to extract information from commit (subject and body) |
161-
| `change_type_order`| `str` | `None` | (OPTIONAL) List of strings used to order the Changelog. All other types will be sorted alphabetically. Default is `["BREAKING CHANGE", "Feat", "Fix", "Refactor", "Perf"]` |
161+
| `change_type_order` | `str` | `None` | (OPTIONAL) List of strings used to order the Changelog. All other types will be sorted alphabetically. Default is `["BREAKING CHANGE", "Feat", "Fix", "Refactor", "Perf"]` |
162162
| `commit_parser` | `str` | `None` | (OPTIONAL) Regex to extract information used in creating changelog. [See more][changelog-spec] |
163163
| `changelog_pattern` | `str` | `None` | (OPTIONAL) Regex to understand which commits to include in the changelog |
164164
| `change_type_map` | `dict` | `None` | (OPTIONAL) Dictionary mapping the type of the commit to a changelog entry |
@@ -215,7 +215,7 @@ Create a Python module, for example `cz_jira.py`.
215215

216216
Inherit from `BaseCommitizen`, and you must define `questions` and `message`. The others are optional.
217217

218-
```python
218+
```python title="cz_jira.py"
219219
from commitizen.cz.base import BaseCommitizen
220220
from commitizen.defaults import Questions
221221
@@ -259,7 +259,7 @@ class JiraCz(BaseCommitizen):
259259
260260
The next file required is `setup.py` modified from flask version.
261261

262-
```python
262+
```python title="setup.py"
263263
from setuptools import setup
264264
265265
setup(
@@ -295,7 +295,7 @@ You need to define 2 parameters inside your custom `BaseCommitizen`.
295295

296296
Let's see an example.
297297

298-
```python
298+
```python title="cz_strange.py"
299299
from commitizen.cz.base import BaseCommitizen
300300
301301
@@ -315,7 +315,7 @@ cz -n cz_strange bump
315315
### Custom changelog generator
316316

317317
The changelog generator should just work in a very basic manner without touching anything.
318-
You can customize it of course, and this are the variables you need to add to your custom `BaseCommitizen`.
318+
You can customize it of course, and the following variables are the ones you need to add to your custom `BaseCommitizen`.
319319

320320
| Parameter | Type | Required | Description |
321321
| -------------------------------- | ------------------------------------------------------------------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
@@ -326,7 +326,7 @@ You can customize it of course, and this are the variables you need to add to yo
326326
| `changelog_hook` | `method: (full_changelog: str, partial_changelog: Optional[str]) -> str` | NO | Receives the whole and partial (if used incremental) changelog. Useful to send slack messages or notify a compliance department. Must return the full_changelog |
327327
| `changelog_release_hook` | `method: (release: dict, tag: git.GitTag) -> dict` | NO | Receives each generated changelog release and its associated tag. Useful to enrich releases before they are rendered. Must return the update release
328328

329-
```python
329+
```python title="cz_strange.py"
330330
from commitizen.cz.base import BaseCommitizen
331331
import chat
332332
import compliance
@@ -376,8 +376,6 @@ class StrangeCommitizen(BaseCommitizen):
376376
return full_changelog
377377
```
378378

379-
[changelog-des]: ./commands/changelog.md#description
380-
381379
### Raise Customize Exception
382380

383381
If you want `commitizen` to catch your exception and print the message, you'll have to inherit `CzException`.
@@ -528,3 +526,4 @@ by:
528526

529527
[template-config]: config.md#template
530528
[extras-config]: config.md#extras
529+
[changelog-des]: ./commands/changelog.md#description

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy