Skip to content

Commit

Permalink
style(check): fix mypy issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Lee-W committed Nov 10, 2024
1 parent c8af618 commit 82db67d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions commitizen/commands/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def _valid_command_argument(self):
for arg in (self.commit_msg_file, self.commit_msg, self.rev_range)
)
if num_exclusive_args_provided == 0 and not sys.stdin.isatty():
self.commit_msg: str | None = sys.stdin.read()
self.commit_msg = sys.stdin.read()
elif num_exclusive_args_provided != 1:
raise InvalidCommandArgumentError(
"Only one of --rev-range, --message, and --commit-msg-file is permitted by check command! "
Expand Down Expand Up @@ -107,7 +107,9 @@ def _get_commits(self):
return [git.GitCommit(rev="", title="", body=msg)]

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

@staticmethod
def _filter_comments(msg: str) -> str:
Expand Down

0 comments on commit 82db67d

Please sign in to comment.