Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion commit_check/branch.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from commit_check.util import get_branch_name, print_error_message, print_suggestion


def check_branch(checks: dict) -> int:
def check_branch(checks: list) -> int:
for check in checks:
if check['check'] == 'branch_name':
if check['regex'] == "":
Expand Down
2 changes: 1 addition & 1 deletion commit_check/commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from commit_check.util import get_commits_info, print_error_message, print_suggestion


def check_commit(checks: dict) -> int:
def check_commit(checks: list) -> int:
for check in checks:
if check['check'] == 'commit_message':
if check['regex'] == "":
Expand Down
2 changes: 1 addition & 1 deletion commit_check/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from commit_check.util import get_commits_info, print_error_message, print_suggestion


def check_git_config(checks: dict, check_type: str) -> int:
def check_git_config(checks: list, check_type: str) -> int:
for check in checks:
if check['check'] == check_type:
if check['regex'] == "":
Expand Down
3 changes: 1 addition & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
project = "commit-check"
copyright = "2022, shenxianpeng"
copyright = "2023, shenxianpeng"
author = "shenxianpeng"
release = "0.1.0"

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand Down
4 changes: 2 additions & 2 deletions tests/util_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,9 @@ def test_print_suggestion(self, capfd):
assert "Suggest to run" in stdout

def test_print_suggestion_exit1(self, capfd):
# Must exit with 1 when None passed
# Must exit with 1 when "" passed
with pytest.raises(SystemExit) as e:
print_suggestion(None)
print_suggestion("")

assert e.value.code == 1
stdout, _ = capfd.readouterr()
Expand Down