Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

version_files relative to configuration file? #1320

Closed Answered by Lee-W
akiross asked this question in Q&A
Discussion options

Hello,

from the documentation, it seems that paths in version_files can be either

  • relative to execution path
  • absolute path
  • glob patterns

I might be missing something, but IMHO a sensible option would be to also specify files relatively to the commitizen configuration file's path. For example:

# /home/myself/project/cz.toml
[tool.commitizen]
version_files = [
 "src/__version__.py", # relative to execution path: won't update if we call `cz bump` from the project `src` dir
 "$CZCONFIG/src/__version__.py", # relative to where the cz config file is, will always update the file
]

In this case, $CZCONFIG would make that path relative to /home/myself/project/.

Is something like this currently possible?

EDIT: clearly I'm avoiding absolute paths so that configurations can be shared among multiple workstation/people/locations/etc.

You must be logged in to vote

I think it's (or should be) based on config file 🤔 If not, it sounds like a bug to me. but I'll need to test it out

Replies: 2 comments

Comment options

I think it's (or should be) based on config file 🤔 If not, it sounds like a bug to me. but I'll need to test it out

You must be logged in to vote
0 replies
Answer selected by akiross
Comment options

This issue is not tracking in #1371

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants

AltStyle によって変換されたページ (->オリジナル) /