Skip to content

fix(customize): resolve info_path from config directory - #2134

Open
draarivpatel-ui wants to merge 1 commit into
commitizen-tools:masterfrom
draarivpatel-ui:fix-customize-info-path
Open

draarivpatel-ui wants to merge 1 commit into
commitizen-tools:masterfrom
draarivpatel-ui:fix-customize-info-path

Conversation

@draarivpatel-ui

Copy link
Copy Markdown

Description

Fixes #1897.

Resolve a relative info_path from the directory that contains the Commitizen configuration file instead of the current working directory. This lets cz info work from subdirectories of a repository.

Checklist

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

  • Yes (please specify the tool below)

Generated-by: AI assistant following the guidelines

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

Documentation Changes

Updated the info_path option description to document how relative paths are resolved.

  • Run uv run poe doc locally to ensure the documentation pages renders correctly
  • Check and fix any broken links (internal or external)

Expected Behavior

cz info displays the configured information file from any directory inside the repository.

Steps to Test This Pull Request

  1. Configure cz_customize with info_path = "README_cz.md" in a repository root.
  2. Run cz info from a subdirectory.
  3. Confirm the file is read from the configuration file directory.

Automated verification: pytest -q tests/test_cz_customize.py passed with 71 tests.

Additional Context

Absolute info_path values keep their existing behavior.

Copilot AI balanced review requested due to automatic review settings November 25, 2026 16:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@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 (083bf2d).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2134   +/-   ##
=======================================
  Coverage   98.29%   98.29%           
=======================================
  Files          61       61           
  Lines        2874     2877    +3     
=======================================
+ Hits         2825     2828    +3     
  Misses         49       49           

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

This branch has not been deployed

No deployments
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.

cz info does not read from info_path for non root directory

2 participants