Closed
Description
Description
Failed to read configuration containing Chinese words
below is the example config content.
[tool.commitizen]
name = "cz_customize"
[tool.commitizen.customize]
message_template = "{{change_type}}:{% if show_message %} {{message}}{% endif %}"
example = "feature: this feature enable customize through config file"
schema = "<type>: <body>"
schema_pattern = "(feature|bug fix):(\\s.*)"
bump_pattern = "^(break|new|fix|hotfix)"
bump_map = {"break" = "MAJOR", "new" = "MINOR", "fix" = "补丁", "hotfix" = "PATCH"}
change_type_order = ["BREAKING CHANGE", "feat", "fix", "refactor", "perf"]
info_path = "cz_customize_info.txt"
info = """
This is customized info
"""
[[tool.commitizen.customize.questions]]
type = "list"
name = "change_type"
choices = [{value = "feature", name = "feature: 新功能."}, {value = "bug fix", name = "bug fix: 修复了一个BUG."}]
message = "选择你要提交的类型"
[[tool.commitizen.customize.questions]]
type = "input"
name = "message"
message = "请输入一个简短的描述当前的提交。"
[[tool.commitizen.customize.questions]]
type = "confirm"
name = "show_message"
message = "您是否要把当前消息应用到提交中?"
Environment
- commitizen version: 2.14.2
- python version: python-3.7
- operating system: windows-10
Solution
Update config/init.py#L31 The mode of reading files is changed from r
to rb