FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

refactor: remove duplicate test classes and fix import style issues by Copilot · Pull Request #354 · commit-check/commit-check · GitHub

refactor: remove duplicate test classes and fix import style issues - #354

Merged
shenxianpeng merged 3 commits into
feature/add-testsfrom
copilot/sub-pr-353
Jan 31, 2026
Merged

refactor: remove duplicate test classes and fix import style issues#354
shenxianpeng merged 3 commits into
feature/add-testsfrom
copilot/sub-pr-353

Conversation

Copilot AI commented Jan 31, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

Addresses code review feedback identifying duplicate test coverage and inconsistent import patterns.

Changes

Removed duplicate test classes in tests/engine_test.py (316 lines):

  • TestComprehensive* classes duplicated existing test coverage for ValidationResult, ValidationContext, CommitMessageValidator, SubjectCapitalizationValidator, SubjectImperativeValidator, SubjectLengthValidator, and ValidationEngine
  • Preserved unique test_validation_engine_validator_map test by moving it to existing TestValidationEngine class

Fixed import style in tests/config_test.py:

  • Removed lambda wrapper: side_effect=lambda name, *args: self._mock_import_error(name, *args) → side_effect=self._mock_import_error
  • Unified import style: import commit_check.config as config → from commit_check.config import toml_load to match module-level imports

All 83 tests pass. Net reduction: 290 lines.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: shenxianpeng <3353385+shenxianpeng@users.noreply.github.com>
Copilot AI changed the title [WIP] Update pre-commit configuration and enhance test coverage refactor: remove duplicate test classes and fix import style issues Jan 31, 2026
Copilot AI requested a review from shenxianpeng January 31, 2026 00:29
shenxianpeng marked this pull request as ready for review January 31, 2026 00:29
shenxianpeng requested a review from a team as a code owner January 31, 2026 00:29

coderabbitai Bot commented Jan 31, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • 🔍 Trigger a full review

Comment @coderabbitai help to get the list of available commands and usage tips.

github-actions Bot added the bug Something isn't working label Jan 31, 2026

Copy link
Copy Markdown

codecov Bot commented Jan 31, 2026
edited
Loading

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.51%. Comparing base (f3f8207) to head (a890e0b).

Additional details and impacted files
@@                  Coverage Diff                  @@
##           feature/add-tests     #354      +/-   ##
=====================================================
- Coverage              93.65%   93.51%   -0.15%     
=====================================================
  Files                      8        8              
  Lines                    694      694              
=====================================================
- Hits                     650      649       -1     
- Misses                    44       45       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

shenxianpeng merged commit b6c26ce into feature/add-tests Jan 31, 2026
26 of 27 checks passed
shenxianpeng deleted the copilot/sub-pr-353 branch January 31, 2026 00:34
shenxianpeng added a commit that referenced this pull request Jan 31, 2026
* feat: Update pre-commit configuration and enhance test coverage

* refactor: remove duplicate test classes and fix import style issues (#354)

* Initial plan

* refactor: remove duplicate test classes and fix code style issues

Co-authored-by: shenxianpeng <3353385+shenxianpeng@users.noreply.github.com>

* chore: Add 'copilot' to allowed branch types

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: shenxianpeng <3353385+shenxianpeng@users.noreply.github.com>
Co-authored-by: Xianpeng Shen <xianpeng.shen@gmail.com>

---------

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: shenxianpeng <3353385+shenxianpeng@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL