Skip to content

refactor(git): move smart_open and EOLType to commitizen.eol - #2132

Closed
MrBubune wants to merge 1 commit into
commitizen-tools:masterfrom
MrBubune:refactor/git-eol-module
Closed

MrBubune wants to merge 1 commit into
commitizen-tools:masterfrom
MrBubune:refactor/git-eol-module

Conversation

@MrBubune

@MrBubune MrBubune commented Nov 25, 2026 •

Copy link
Copy Markdown

Description

Part of #2129.

smart_open and EOLType handle file line endings, not git commands. Move them from commitizen/git.py to a new commitizen/eol.py module, and update the internal imports.

commitizen.git still exports both names (from commitizen.eol import smart_open as smart_open), so existing imports and third-party plugins keep working.

Checklist

Was generative AI tooling used to co-author this PR?

  • Yes (please specify the tool below)

Generated-by: Claude Code following the guidelines. AI suggested the changes; I wrote and reviewed the code by hand.

Code Changes

  • Add test cases to all the changes you introduce
  • Run uv run poe all locally to ensure this change passes linter check and tests
  • Manually test the changes:
    • Verify the feature/bug fix works as expected in real-world scenarios
    • Test edge cases and error conditions
    • Ensure backward compatibility is maintained
    • Document any manual testing steps performed
  • Update the documentation for the changes

Expected Behavior

No change. from commitizen.git import smart_open, EOLType still works.

Steps to Test This Pull Request

  1. uv run poe all
  2. tests/test_git.py still uses git.EOLType and passes, which confirms the re-export.

Additional Context

In commands/changelog.py, ruff (rule TC001) moved the GitTag import into the TYPE_CHECKING block because that import line changed. Pure refactor, so no docs change.

These handle file line endings, not git commands. commitizen.git still
exports both names, so existing imports keep working.
@codecov

codecov Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.29%. Comparing base (fb3d172) to head (23456b9).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2132   +/-   ##
=======================================
  Coverage   98.29%   98.29%           
=======================================
  Files          61       62    +1     
  Lines        2874     2880    +6     
=======================================
+ Hits         2825     2831    +6     
  Misses         49       49           

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

@woile

woile commented Nov 26, 2026

Copy link
Copy Markdown
Member

Hi thanks for this but it doesn't add any value

@woile woile closed this Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants