@@ -13,6 +13,7 @@ def main(argv=[]):
1313 )
1414 parser .add_argument ("types" , type = str , nargs = "*" , default = format .DEFAULT_TYPES , help = "Optional list of types to support" )
1515 parser .add_argument ("input" , type = str , help = "A file containing a git commit message" )
16+ parser .add_argument ("--no-color" , action = "store_false" , default = True , dest = "color" , help = "Disable color in output." )
1617 parser .add_argument (
1718 "--force-scope" , action = "store_false" , default = True , dest = "optional_scope" , help = "Force commit to have scope defined."
1819 )
@@ -47,7 +48,7 @@ def main(argv=[]):
4748 with open (args .input , encoding = "utf-8" ) as f :
4849 commit_msg = f .read ()
4950 except UnicodeDecodeError :
50- print (output .unicode_decode_error ())
51+ print (output .unicode_decode_error (args . color ))
5152 return RESULT_FAIL
5253 if args .scopes :
5354 scopes = args .scopes .split ("," )
@@ -61,12 +62,16 @@ def main(argv=[]):
6162 if format .is_conventional (commit_msg , args .types , args .optional_scope , scopes ):
6263 return RESULT_SUCCESS
6364
64- print (output .fail (commit_msg ))
65+ print (output .fail (commit_msg , use_color = args . color ))
6566
6667 if not args .verbose :
67- print (output .verbose_arg ())
68+ print (output .verbose_arg (use_color = args . color ))
6869 else :
69- print (output .fail_verbose (commit_msg , args .types , args .optional_scope , scopes ))
70+ print (
71+ output .fail_verbose (
72+ commit_msg , types = args .types , optional_scope = args .optional_scope , scopes = scopes , use_color = args .color
73+ )
74+ )
7075
7176 return RESULT_FAIL
7277
0 commit comments