File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -53,11 +53,11 @@ def __call__(self):
5353 ill_formated_commits = [
5454 commit
5555 for commit in commits
56- if not Check .validate_commit_message (commit [ "msg" ] , pattern )
56+ if not Check .validate_commit_message (commit . message , pattern )
5757 ]
58- displayed_msgs_content = "" .join (
58+ displayed_msgs_content = "\n " .join (
5959 [
60- f"commit { commit [ ' rev' ] or '' } : { commit [ 'msg' ] } \n "
60+ f"commit { commit . rev } : { commit . message } "
6161 for commit in ill_formated_commits
6262 ]
6363 )
@@ -74,14 +74,18 @@ def _get_commits(self):
7474 # Get commit message from file (--commit-msg-file)
7575 if self .commit_msg_file :
7676 with open (self .commit_msg_file , "r" ) as commit_file :
77- commit_msg = commit_file .read ()
78- return [{"rev" : None , "msg" : commit_msg }]
77+ commit_title = commit_file .readline ()
78+ commit_body = commit_file .read ()
79+ return [
80+ git .GitCommit (
81+ rev = "" ,
82+ title = commit_title ,
83+ body = commit_body ,
84+ )
85+ ]
7986
8087 # Get commit messages from git log (--rev-range)
81- return [
82- {"rev" : commit .rev [:8 ], "msg" : commit .message }
83- for commit in git .get_commits (end = self .rev_range )
84- ]
88+ return git .get_commits (end = self .rev_range )
8589
8690 @staticmethod
8791 def validate_commit_message (commit_msg : str , pattern : str ) -> bool :
You can’t perform that action at this time.
0 commit comments