diff --git a/commit_check/util.py b/commit_check/util.py index 2d9c9703..af68cf07 100644 --- a/commit_check/util.py +++ b/commit_check/util.py @@ -12,14 +12,6 @@ from commit_check import RED, GREEN, YELLOW, RESET_COLOR -def _find_check(checks: list, check_type: str) -> dict | None: - """Return the first check dict matching check_type, else None.""" - for check in checks: - if check.get("check") == check_type: - return check - return None - - def _print_failure( check: dict, actual: str, diff --git a/tests/util_test.py b/tests/util_test.py index 7b2bbf0f..2a106b00 100644 --- a/tests/util_test.py +++ b/tests/util_test.py @@ -15,7 +15,6 @@ print_error_header, print_error_message, print_suggestion, - _find_check, ) from subprocess import CalledProcessError, PIPE from unittest.mock import MagicMock @@ -615,32 +614,6 @@ def test_print_suggestion_exit1(self, capfd): stdout, _ = capfd.readouterr() assert "commit-check does not support" in stdout - class TestHelperFunctions: - """Tests for utility helper functions to improve coverage.""" - - def test_find_check_found(self): - """Test _find_check when check is found.""" - checks = [ - {"check": "commit-message", "regex": ".*"}, - {"check": "branch-name", "regex": ".*"}, - ] - result = _find_check(checks, "commit-message") - assert result == {"check": "commit-message", "regex": ".*"} - - def test_find_check_not_found(self): - """Test _find_check when check is not found.""" - checks = [ - {"check": "commit-message", "regex": ".*"}, - ] - result = _find_check(checks, "author-name") - assert result is None - - def test_find_check_empty_list(self): - """Test _find_check with empty list.""" - checks = [] - result = _find_check(checks, "commit-message") - assert result is None - class TestGetGitConfigValue: """Tests for get_git_config_value utility function."""