Skip to content

Commit ba16783

Browse files
josixLee-W
authored andcommitted
style(cz_check): Update ill-formatted codes
1 parent 34fca28 commit ba16783

File tree

2 files changed

+5
-14
lines changed

2 files changed

+5
-14
lines changed

commitizen/commands/check.py

+1-7
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,7 @@ def _get_commits(self):
7676
with open(self.commit_msg_file, "r") as commit_file:
7777
commit_title = commit_file.readline()
7878
commit_body = commit_file.read()
79-
return [
80-
git.GitCommit(
81-
rev="",
82-
title=commit_title,
83-
body=commit_body,
84-
)
85-
]
79+
return [git.GitCommit(rev="", title=commit_title, body=commit_body)]
8680

8781
# Get commit messages from git log (--rev-range)
8882
return git.get_commits(end=self.rev_range)

tests/commands/test_check_command.py

+4-7
Original file line numberDiff line numberDiff line change
@@ -211,13 +211,10 @@ def test_check_command_with_empty_range(config, mocker):
211211

212212
def test_check_a_range_of_failed_git_commits(config, mocker):
213213
ill_formated_commits_msgs = [
214-
"First commit does not follow rule",
215-
"Second commit does not follow rule",
216-
(
217-
"Third commit does not follow rule\n"
218-
"Ill-formatted commit with body"
219-
)
220-
]
214+
"First commit does not follow rule",
215+
"Second commit does not follow rule",
216+
("Third commit does not follow rule\n" "Ill-formatted commit with body"),
217+
]
221218
mocker.patch(
222219
"commitizen.git.get_commits",
223220
return_value=_build_fake_git_commits(ill_formated_commits_msgs),

0 commit comments

Comments
 (0)