| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. Warning Rate limit exceeded@shenxianpeng has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 14 minutes and 28 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR. We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📥 CommitsReviewing files that changed from the base of the PR and between bccd3dc and 8a4161e. 📒 Files selected for processing (1)
WalkthroughCentralizes check lookup and failure reporting by adding commit_check.util._find_check and _print_failure; refactors author/branch/commit checks to use these helpers, adds commit-message helpers/fallbacks, updates tests to patch commit_check.util, and adds a pytest marker in pyproject.toml. Early-return behavior standardized. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Runner
participant Checker as check_* functions
participant Util as commit_check.util._find_check
participant VCS as VCS/FS (git/get_commit_info)
participant Printer as commit_check.util._print_failure
Runner->>Checker: run(checks)
Checker->>Util: _find_check(checks, type)
alt not found or regex empty
Checker-->>Runner: PASS
else found
Checker->>VCS: obtain actual value (branch/author/msg)
alt matches regex
Checker-->>Runner: PASS
else mismatch
Checker->>Printer: _print_failure(check, regex, actual)
Checker-->>Runner: FAIL
end
end
sequenceDiagram
autonumber
actor Runner
participant Commit as check_commit_msg
participant FS as _ensure_msg_file / read_commit_msg
participant Printer as commit_check.util._print_failure
Runner->>Commit: run(checks)
Commit->>FS: resolve and read commit message
Commit->>Commit: re.match(regex, message)
alt match
Commit-->>Runner: PASS
else no match
Commit->>Printer: _print_failure(...)
Commit-->>Runner: FAIL
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labelsminor Pre-merge checks (2 passed, 3 warnings)❌ Failed Checks (3 warnings)
Poem✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. ❤️ ShareComment @coderabbitai help to get the list of available commands and usage tips. |
Sorry, something went wrong.
Codecov Report❌ Patch coverage is 98.03922% with 2 lines in your changes missing coverage. Please review.
@@ Coverage Diff @@
## main #276 +/- ##
==========================================
- Coverage 99.14% 99.13% -0.01%
==========================================
Files 8 8
Lines 350 346 -4
==========================================
- Hits 347 343 -4
Misses 3 3 ☔ View full report in Codecov by Sentry.
|
Sorry, something went wrong.
CodSpeed Performance ReportMerging #276 will improve performances by 58.16%Comparing bugfix/refactor-function (8a4161e) with main (313d2ea) Summary⚡ 5 improvements Benchmarks breakdown
|
Sorry, something went wrong.
There was a problem hiding this comment.
Actionable comments posted: 7
🧹 Nitpick comments (5)pyproject.toml (1)📜 Review detailscommit_check/author.py (1)71-75: Optional: pin pytest minimum version for pyproject-based config.
Small guard to avoid older pytest parsing differences.
Apply this diff:
[tool.pytest.ini_options] +# Ensure a modern pytest that fully supports pyproject config +minversion = "7.0" # Silence PytestUnknownMarkWarning for custom marks used in tests markers = [ "benchmark: performance-related tests (no-op marker in this project)", ]commit_check/branch.py (2)28-31: Optional: assert known author check types.
Preempt accidental misuse and avoid calling git with an empty format string.
Apply this diff:
def _get_author_value(check_type: str) -> str: """Fetch the author value from git for the given check type.""" - format_str = _AUTHOR_FORMAT_MAP.get(check_type, "") + format_str = _AUTHOR_FORMAT_MAP.get(check_type, "") + if not format_str: # defensive + return "" return str(get_commit_info(format_str))commit_check/commit.py (1)33-39: Optional: tolerate missing 'error'/'suggest' keys.
Use .get with defaults to avoid KeyError on partial configs.
Apply this diff:
- print_error_message( - check['check'], regex, - check['error'], branch_name, - ) - if check.get('suggest'): - print_suggestion(check['suggest']) + print_error_message( + check.get('check', 'branch'), regex, + check.get('error', ''), branch_name, + ) + if check.get('suggest'): + print_suggestion(check['suggest'])
71-77: Optional: same defensive .get usage for merge_base.
Apply this diff:
- print_error_message( - merge_check['check'], regex, - merge_check['error'], current_branch, - ) - if merge_check.get('suggest'): - print_suggestion(merge_check['suggest']) + print_error_message( + merge_check.get('check', 'merge_base'), regex, + merge_check.get('error', ''), current_branch, + ) + if merge_check.get('suggest'): + print_suggestion(merge_check['suggest'])30-36: Centralize _find_check to avoid duplication across modules
This duplicates commit_check/author.py::_find_check. Consider moving a single find_check helper to commit_check.util and importing it here and in other modules.
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📥 CommitsReviewing files that changed from the base of the PR and between dc169ba and 4e14363.
📒 Files selected for processing (4)Learnt from: CR PR: commit-check/commit-check#0 File: .github/copilot-instructions.md:0-0 Timestamp: 2025-09-07T15:16:47.288Z Learning: Ensure author information in commits is valid: proper author name and email formats
Applied to files:
commit_check/util.py (5)commit_check/branch.py (2)commit_check/main.py (1)
- get_commit_info (48-67)
- has_commits (33-46)
- print_error_header (128-144)
- print_error_message (147-159)
- print_suggestion (162-173)
- main (106-136)
commit_check/util.py (5)commit_check/commit.py (4)tests/branch_test.py (5)
- get_branch_name (15-30)
- print_error_header (128-144)
- print_error_message (147-159)
- print_suggestion (162-173)
- git_merge_base (70-84)
- TestCheckBranch (10-120)
- test_check_merge_base_with_different_check (144-152)
- TestCheckMergeBase (123-169)
- test_check_branch_with_different_check (49-66)
- test_check_merge_base_with_empty_regex (133-141)
commit_check/author.py (1)⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)commit_check/util.py (5)
- _find_check (20-25)
commit_check/main.py (1)
- print_error_header (128-144)
- print_error_message (147-159)
- print_suggestion (162-173)
- has_commits (33-46)
- get_commit_info (48-67)
tests/commit_test.py (2)
- main (106-136)
- test_check_imperative_different_check_type (348-362)
- test_check_imperative_empty_checks (382-393)
pyproject.toml (1)commit_check/commit.py (7)71-75: Registering the custom pytest marker looks good.
This silences PytestUnknownMarkWarning and documents the benchmark mark.
38-43: LGTM: robust fallback for commit message file
Helper cleanly normalizes empty input to default path.
58-66: LGTM: early exit and clear skip messaging when regex missing
Flow is simple and avoids unnecessary I/O.
67-75: LGTM: standardized failure path via _print_failure
Good reuse and early return structure.
81-89: LGTM: signoff check retrieval and empty-regex skip
Matches the new pattern used across modules.
90-99: LGTM: merge commits correctly skipped by subject prefix
Simple and correct.
115-116: LGTM: no-commit fast path
Avoids running checks in fresh repos.
117-137: LGTM: imperative check flow and conventional-commit description extraction
The colon-split heuristic is clear and keeps the function concise.
Sorry, something went wrong.
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)pyproject.toml (1)14-14: Bump Python requirement to ≥3.10
Code uses PEP 604 unions (| None) in commit_check/util.py (lines 15–16) and commit_check/commit.py (lines 13–14), which require Python 3.10+. Update pyproject.toml accordingly:
pyproject.toml 14c14 - requires-python = ">=3.9" + requires-python = ">=3.10" @@ - "Programming Language :: Python :: 3.9", + # remove or update this classifier to 3.10+
commit_check/branch.py (1)🧹 Nitpick comments (7)4-4: Python 3.9 compat: imported _find_check likely uses PEP 604 unions
util._find_check is annotated as dict | None in the repo snippets; this breaks on Python 3.9. Please switch to Optional[dict] in commit_check/util.py (and elsewhere) or drop the annotation.
Run to locate offenders:
#!/bin/bash # Find PEP 604 unions that will fail on Python 3.9 rg -nP --type=py '\b[A-Za-z_][A-Za-z0-9_\[\],\s]*\|\s*None\b|->\s*[A-Za-z_][A-Za-z0-9_\[\],\s]*\|\s*None\b' -C2
commit_check/author.py (1)📜 Review detailscommit_check/commit.py (2)26-31: Harden failure printing: guard header flag and avoid KeyError
Use getattr to avoid AttributeError and .get() to avoid KeyError if config misses fields.
def _print_failure(check: dict, regex: str, actual: str) -> None: - if not print_error_header.has_been_called: - print_error_header() - print_error_message(check['check'], regex, check['error'], actual) + if not getattr(print_error_header, "has_been_called", False): + print_error_header() + print_error_message(str(check.get('check', "")), regex, str(check.get('error', "")), actual) if check.get('suggest'): print_suggestion(check['suggest'])commit_check/branch.py (4)20-26: Unify failure handling: guard header flag and avoid KeyError
Mirror the robustness used elsewhere.
def _print_failure(check: dict, regex: str, actual: str) -> None: - if not print_error_header.has_been_called: - print_error_header() # pragma: no cover - print_error_message(check['check'], regex, check['error'], actual) + if not getattr(print_error_header, "has_been_called", False): + print_error_header() # pragma: no cover + print_error_message(str(check.get('check', "")), regex, str(check.get('error', "")), actual) if check.get('suggest'): print_suggestion(check['suggest'])
90-95: Micro-opt: defer git hash lookup until failure
Avoids a subprocess on success path.
- commit_hash = get_commit_info("H") if re.search(regex, commit_msg): return PASS - _print_failure(check, regex, commit_hash) + commit_hash = get_commit_info("H") + _print_failure(check, regex, commit_hash) return FAIL22-24: Polish the skip message
More concise and consistent wording.
- print( - f"{YELLOW}Not found regex for branch naming. skip checking.{RESET_COLOR}", - ) + print(f"{YELLOW}No branch regex configured; skipping check.{RESET_COLOR}")
28-29: Consider fullmatch for exact branch rule compliance
re.match allows partial matches unless the pattern is anchored; fullmatch enforces whole-string validation.
- if re.match(regex, branch_name): + if re.fullmatch(regex, branch_name): return PASS
49-55: Polish the merge_base skip message
Clearer wording.
- if regex == "": - print( - f"{YELLOW}Not found target branch for checking merge base. skip checking.{RESET_COLOR}", - ) + if regex == "": + print(f"{YELLOW}No target branch configured for merge_base; skipping check.{RESET_COLOR}") return PASS
56-56: Avoid false positives when detecting existing origin/ prefix
Use startswith to prevent accidental matches where "origin/" appears elsewhere in the string.
- target_branch = regex if "origin/" in regex else f"origin/{regex}" + target_branch = regex if regex.startswith("origin/") else f"origin/{regex}"
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📥 CommitsReviewing files that changed from the base of the PR and between 313d2ea and 6d4fff6.
📒 Files selected for processing (5)tests/branch_test.py (4)commit_check/author.py (2)tests/commit_test.py (1)
- TestCheckBranch (10-120)
- test_check_branch_with_empty_checks (32-46)
- test_check_branch_with_different_check (49-66)
- test_check_branch_with_result_none (93-120)
- test_check_commit_with_different_check (70-81)
commit_check/util.py (6)commit_check/branch.py (4)tests/author_test.py (4)
- get_commit_info (56-75)
- has_commits (41-54)
- print_error_header (136-152)
- print_error_message (155-167)
- print_suggestion (170-181)
- _find_check (15-20)
- test_check_author_with_different_check (73-90)
- test_check_author_with_different_check (188-205)
- test_check_author (16-33)
- test_check_author (151-168)
commit_check/util.py (7)commit_check/commit.py (6)commit_check/author.py (1)
- _find_check (15-20)
- get_branch_name (23-38)
- git_merge_base (78-92)
- print_error_header (136-152)
- print_error_message (155-167)
- print_suggestion (170-181)
- has_commits (41-54)
commit_check/commit.py (1)
- _print_failure (26-31)
tests/branch_test.py (4)
- _print_failure (20-25)
- TestCheckBranch (10-120)
- test_check_merge_base_with_different_check (144-152)
- TestCheckMergeBase (123-169)
- test_check_merge_base_with_empty_regex (133-141)
noxfile.py (1)⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)commit_check/util.py (7)
- commit_check (45-47)
commit_check/author.py (1)
- _find_check (15-20)
- cmd_output (95-109)
- get_commit_info (56-75)
- print_error_header (136-152)
- print_error_message (155-167)
- print_suggestion (170-181)
- has_commits (41-54)
commit_check/branch.py (1)
- _print_failure (26-31)
commit_check/main.py (1)
- _print_failure (7-12)
tests/commit_test.py (5)
- main (106-136)
- test_check_commit_with_different_check (70-81)
- test_check_imperative_skip_merge_commit (329-344)
- test_check_imperative_empty_checks (382-393)
- test_check_imperative_different_check_type (348-362)
- test_check_commit_signoff_still_fails_non_merge_without_signoff (226-250)
pyproject.toml (1)commit_check/author.py (1)71-75: Pytest marker config: LGTM
Silences PytestUnknownMarkWarning cleanly without side effects.
commit_check/commit.py (2)39-47: Early-return flow for empty regex: LGTM
Skips I/O and regex work when config lacks a pattern; message is clear.
commit_check/branch.py (1)60-65: Message regex check path: LGTM
Single lookup + early return reduces branching and work done.
110-126: Imperative mood check refactor: LGTM
Clear skip conditions and focused subject parsing keep complexity low.
16-19: Nice complexity reduction via early return
Using _find_check and bailing out early simplifies control flow.
Sorry, something went wrong.
There was a problem hiding this comment.
This PR refactors the commit-check codebase to reduce cognitive complexity by centralizing validation logic and improving code organization. The refactoring introduces helper functions to eliminate repetitive code patterns and standardizes error handling across different validation modules.
Key changes:
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file| File | Description |
|---|---|
| commit_check/util.py | Added centralized helper functions _find_check and _print_failure for standardized validation flow |
| commit_check/commit.py | Refactored commit message, signoff, and imperative checks to use centralized helpers and reduce complexity |
| commit_check/branch.py | Simplified branch and merge base validation by removing loops and using helper functions |
| commit_check/author.py | Streamlined author validation with centralized logic and improved organization |
| tests/*.py | Updated test mocks to reference relocated utility functions and added pytest marker configuration |
| pyproject.toml | Added pytest configuration to silence warnings for custom test markers |
Sorry, something went wrong.
|
✅ Actions performed
Full review triggered. |
Sorry, something went wrong.
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)tests/commit_test.py (2)tests/branch_test.py (1)31-35: Fix expectation: read_commit_msg should call util.get_commit_info when file is missing
read_commit_msg falls back to subject+body via util.get_commit_info; expecting zero calls is incorrect. Assert two calls and the composed result.
Apply this diff:
- m_commits_info = mocker.patch('commit_check.util.get_commit_info', return_value='mocked_commits_info') - read_commit_msg("non_existent_file.txt") - assert m_commits_info.call_count == 0 + m_commits_info = mocker.patch('commit_check.util.get_commit_info', return_value='mocked') + result = read_commit_msg("non_existent_file.txt") + assert m_commits_info.call_count == 2 + # expect subject ("s") then body ("b") + from unittest import mock + m_commits_info.assert_has_calls([mock.call("s"), mock.call("b")]) + assert result == "mocked\n\nmocked"
38-55: Stabilize tests: patch has_commits(True) where downstream behavior is asserted
These tests can short-circuit early if the repo has no commits, making them flaky. Explicitly patch has_commits to True within each test.
Apply patterns like this at the top of each affected test:
def test_check_commit_msg_no_commit_msg_file(mocker): + mocker.patch("commit_check.commit.has_commits", return_value=True)def test_check_commit_with_len0_regex(mocker, capfd): + mocker.patch("commit_check.commit.has_commits", return_value=True)def test_check_commit_with_result_none(mocker): + mocker.patch("commit_check.commit.has_commits", return_value=True)def test_check_commit_signoff(mocker): + mocker.patch("commit_check.commit.has_commits", return_value=True)def test_check_commit_signoff_still_fails_non_merge_without_signoff(mocker): + mocker.patch("commit_check.commit.has_commits", return_value=True)def test_check_imperative_fail_past_tense(mocker): + mocker.patch("commit_check.commit.has_commits", return_value=True)def test_check_imperative_fail_present_continuous(mocker): + mocker.patch("commit_check.commit.has_commits", return_value=True)Also applies to: 85-101, 103-126, 129-156, 226-251, 273-298, 301-326
155-170: Fix ineffective patching: local import bypasses your mock and test may hit real git.
Because the test does from commit_check.branch import check_merge_base, patching f"{LOCATION}.check_merge_base" (Line 162) doesn’t affect the locally imported check_merge_base. Also, the function calls has_commits() and git_merge_base(), which will touch the environment unless mocked. Patch util dependencies instead.
Apply this diff within this test to mock the right call sites:
@@ - mocker.patch(f"{LOCATION}.check_merge_base", return_value=1) - m_print_error = mocker.patch("commit_check.util.print_error_message") - m_print_suggest = mocker.patch("commit_check.util.print_suggestion") + mocker.patch("commit_check.util.has_commits", return_value=True) + mocker.patch("commit_check.util.get_branch_name", return_value="feature/x") + mocker.patch("commit_check.util.git_merge_base", return_value=1) + m_print_error = mocker.patch("commit_check.util.print_error_message") + m_print_suggest = mocker.patch("commit_check.util.print_suggestion")Also fix the three earlier merge-base tests to assert no git calls instead of patching the function under test:
@@ def test_check_merge_base_with_empty_checks(self, mocker): - m_check_merge = mocker.patch(f"{LOCATION}.check_merge_base") + mocker.patch("commit_check.util.has_commits", return_value=True) + m_git_merge_base = mocker.patch("commit_check.util.git_merge_base") @@ - assert m_check_merge.call_count == 0 + assert m_git_merge_base.call_count == 0 @@ def test_check_merge_base_with_empty_regex(self, mocker): - m_check_merge = mocker.patch(f"{LOCATION}.check_merge_base") + mocker.patch("commit_check.util.has_commits", return_value=True) + m_git_merge_base = mocker.patch("commit_check.util.git_merge_base") @@ - assert m_check_merge.call_count == 0 + assert m_git_merge_base.call_count == 0 @@ def test_check_merge_base_with_different_check(self, mocker): - m_check_merge = mocker.patch(f"{LOCATION}.check_merge_base") + mocker.patch("commit_check.util.has_commits", return_value=True) + m_git_merge_base = mocker.patch("commit_check.util.git_merge_base") @@ - assert m_check_merge.call_count == 0 + assert m_git_merge_base.call_count == 0Optional: add capfd assertion for the empty-regex warning to mirror branch tests.
commit_check/commit.py (2)🧹 Nitpick comments (8)13-18: Replace PEP 604 str | None with Optional[str] or bump supported Python
Project metadata previously targeted Python >=3.9; X | None requires 3.10+. Use Optional[str] to retain 3.9 support, or update requires-python to >=3.10.
+from typing import Optional @@ -def _ensure_msg_file(commit_msg_file: str | None) -> str: +def _ensure_msg_file(commit_msg_file: Optional[str]) -> str:#!/bin/bash # Confirm declared Python version to decide between Optional vs. 3.10+ rg -n "requires-python|Programming Language :: Python ::" -S pyproject.toml || true
55-57: Guard header gating inside util._print_failure to avoid AttributeError
current implementation in util reads print_error_header.has_been_called directly, which can crash on first call. Use getattr/setattr there.
Apply in commit_check/util.py (for reference):
- if not print_error_header.has_been_called: - print_error_header() + if not getattr(print_error_header, "has_been_called", False): + print_error_header() # pragma: no cover + setattr(print_error_header, "has_been_called", True)Also applies to: 86-87, 116-118
tests/commit_test.py (1)📜 Review detailstests/author_test.py (1)52-55: Use PASS constant instead of magic number
Avoid asserting literal 0; assert against PASS for clarity and resilience.
- assert result == 0 + assert result == PASScommit_check/commit.py (3)260-261: Remove duplicate assertion
The second identical assert is redundant.
- assert m_print_suggestion.call_count == 1commit_check/branch.py (3)26-34: Tighten typing and drop unnecessary str()
Add a type for commit_msg_file; no need to wrap concatenated string with str().
-def read_commit_msg(commit_msg_file) -> str: +def read_commit_msg(commit_msg_file: str) -> str: @@ - except FileNotFoundError: - # Commit message is composed by subject and body - return str(get_commit_info("s") + "\n\n" + get_commit_info("b")) + except FileNotFoundError: + # Fallback to subject + body when file is absent + return get_commit_info("s") + "\n\n" + get_commit_info("b")
35-57: Reduce noise: show subject in failure instead of full message
Printing the entire message can be verbose. Passing the subject keeps output focused.
- if re.match(regex, commit_msg): + if re.match(regex, commit_msg): return PASS - - _print_failure(check, regex, commit_msg) + + subject = commit_msg.split('\n')[0].strip() + _print_failure(check, regex, subject) return FAIL
82-87: Avoid unnecessary git calls on success path
Only fetch commit hash if the regex fails.
- commit_hash = get_commit_info("H") - if re.search(regex, commit_msg): - return PASS - - _print_failure(check, regex, commit_hash) - return FAIL + if re.search(regex, commit_msg): + return PASS + + commit_hash = get_commit_info("H") + _print_failure(check, regex, commit_hash) + return FAIL20-21: Prefer fullmatch for branch naming rules.
re.match allows partial prefixes; most naming policies expect the whole branch to conform.
- if re.match(regex, branch_name): + if re.fullmatch(regex, branch_name): return PASS
42-47: Consistent warning mechanism.
Consider routing warnings through a shared helper (e.g., util.print_warning(...)) to keep messaging uniform across modules and simplify testing.
48-49: Nit: use startswith for remote prefix.
"origin/" in regex can misfire on exotic patterns; regex.startswith("origin/") is stricter.
- target_branch = regex if "origin/" in regex else f"origin/{regex}" + target_branch = regex if regex.startswith("origin/") else f"origin/{regex}"
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📥 CommitsReviewing files that changed from the base of the PR and between 6d4fff6 and bfb2edb.
📒 Files selected for processing (7)tests/util_test.py (2)commit_check/branch.py (2)
- TestUtil (16-323)
- TestGetCommitInfo (116-180)
noxfile.py (1)commit_check/commit.py (3)commit_check/util.py (5)
- commit_check (45-47)
- _find_check (15-20)
- _print_failure (23-33)
- get_branch_name (36-51)
- git_merge_base (91-105)
- has_commits (54-67)
noxfile.py (1)⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)commit_check/util.py (5)
- commit_check (45-47)
commit_check/main.py (1)
- _find_check (15-20)
- _print_failure (23-33)
- cmd_output (108-122)
- get_commit_info (69-88)
- has_commits (54-67)
- main (106-136)
tests/commit_test.py (1)tests/author_test.py (2)8-8: LGTM: patching util-level printers
Switching LOCATION to "commit_check.util" aligns with the refactor.
tests/branch_test.py (1)134-138: LGTM: patch print_error_message/print_suggestion at util-level
Targets match the refactor centralizing output.
249-253: LGTM: consistent util-level patches here as well
Matches the new design.
commit_check/branch.py (1)110-114: Mocks redirected to util — correct alignment.
Patching commit_check.util.print_error_message and print_suggestion matches the centralization. LGTM.
8-24: Early-return refactor reads well and reduces complexity.
Centralized lookup/printing and short-circuiting paths look good.
Sorry, something went wrong.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
closes #275
Summary by CodeRabbit