2626 - id : conventional-pre-commit
2727 stages : [commit-msg]
2828 args : [] # optional: list of Conventional Commits types to allow e.g. [feat, fix, ci, chore, test]
29+ # if you want to set encoding, use --encoding=<encoding>, before types
2930```
3031
3132Install the ` pre-commit ` script:
@@ -79,6 +80,22 @@ Conventional Commit......................................................Passed
7980- duration: 0.05s
8081```
8182
83+ ### Configure encoding
84+
85+ ** For Windows user** , if you want to use ` conventional-pre-commit ` with non-ascii characters, you can set encoding with ` --encoding=<encoding> ` .
86+
87+ ``` yaml
88+ args : [--encoding=<encoding>]
89+ ` ` `
90+
91+ or
92+
93+ ` ` ` yaml
94+ args : [--encoding=<encoding>, feat, ...(other custom types)]
95+ ` ` `
96+
97+ **The encoding argument must be in front of types.**
98+
8299## Install with pip
83100
84101` conventional-pre-commit` can also be installed and used from the command line:
@@ -90,15 +107,17 @@ pip install conventional-pre-commit
90107Then run the command line script :
91108
92109` ` ` shell
93- conventional-pre-commit [types] input
110+ conventional-pre-commit [--encoding] [ types] input
94111` ` `
95112
96- Where `[types]` is an optional list of Conventional Commit types to allow (e.g. `feat fix chore`)
113+ - ` --encoding` is an optional encoding to use (e.g. `--encoding=utf-8`)
114+
115+ - ` [types]` is an optional list of Conventional Commit types to allow (e.g. `feat fix chore`)
97116
98- And `input` is a file containing the commit message to check :
117+ - `input` is a file containing the commit message to check :
99118
100119` ` ` shell
101- conventional-pre-commit feat fix chore ci test .git/COMMIT_MSG
120+ conventional-pre-commit --encoding=utf-8 feat fix chore ci test .git/COMMIT_MSG
102121` ` `
103122
104123Or from a Python program :
0 commit comments