File tree 3 files changed +6
-3
lines changed
3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change
1
+ from jinja2 import Template
2
+
1
3
from commitizen import defaults
2
4
from commitizen .cz .base import BaseCommitizen
3
5
@@ -24,8 +26,8 @@ def questions(self) -> list:
24
26
return self .custom_config .get ("questions" )
25
27
26
28
def message (self , answers : dict ) -> str :
27
- message_template = self .custom_config .get ("message_template" )
28
- return message_template .format (** answers )
29
+ message_template = Template ( self .custom_config .get ("message_template" ) )
30
+ return message_template .render (** answers )
29
31
30
32
def example (self ) -> str :
31
33
return self .custom_config .get ("example" )
Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ colorama = "^0.4.1"
51
51
termcolor = " ^1.1"
52
52
packaging = " ^19.0"
53
53
tomlkit = " ^0.5.3"
54
+ jinja2 = " ^2.10.3"
54
55
55
56
[tool .poetry .dev-dependencies ]
56
57
ipython = " ^7.2"
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ def config():
11
11
toml_str = """
12
12
[tool.commitizen.customize]
13
13
# message_template should follow the python string formatting spec
14
- message_template = "{change_type}: {message}"
14
+ message_template = "{{ change_type}} : {{ message} }"
15
15
example = "feature: this feature eanable customize through config file"
16
16
schema = "<type>: <body>"
17
17
bump_pattern = "^(break|new|fix|hotfix)"
You can’t perform that action at this time.
0 commit comments