Discussion on check-consistency
See original GitHub issueDescription
Hi,
I’ve doubt on how check-consistency
flag works.
Steps to reproduce
- have a project managed with poetry, with a pyproject.toml like the following
[tool.poetry]
name = "cool_proj"
version = "2.5.7" <<<< this is mandatory for poetry to make the package
...
[tool.commitizen]
name = "cz_conventional_commits"
version = "2.5.2" <<<< this is mandatory for commitizen
version_files = [
"cool_proj/__init__.py:__version__",
"pyproject.toml:version"
]
and __init__.py
contains
__version__ = "2.5.2"
- run
poetry run cz bump --check-consistency
Current behavior
the command works, it prints on stdout
Bump version: 2.5.2 -> 2.5.3 <<< it takes the value from commitizen's toml section
tag to create: 2.5.3
Desired behavior
the expected could be a warning about version not consistent, because at least content of __init__.py
differ from the expected (the one into commitizen’s toml section).
looking at implementation, also the regex usage has major drawback in this kind of setup, because the regex surely find commitizen’s “version” attribute, but it can miss the poetry’s one, creating package with wrong number (it’s taken from poetry section).
Screenshots
No response
Environment
- commitizen 2.34.0
- python 3.9.13
- windows 11
Issue Analytics
- State:
- Created a year ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
GameObject does not reference component MonoBehaviour ...
CheckConsistency : GameObject does not reference component MonoBehaviour. Fixing. Discussion in 'Editor & General Support' started by ...
Read more >checkConsistency | Apple Developer Documentation
Discussion. The value for this key is an NSNumber object containing a Boolean value. The default value is false . If you set...
Read more >Warning: SendMessage cannot be called during Awake ...
SendMessage cannot be called during Awake, CheckConsistency, or OnValidate UnityEngine.GameObject:AddComponent<DG.Tweening.Core.
Read more >"Check consistency" | NI Community Forum - Native Instruments
Folks, I've analysed some music in Mixed In Key. You need to run "Check consistency" in Traktor so the keys display.
Read more >Re: Flow Check consistency issue, most objects unchecked
Sign up to take part. Registered users can ask their own questions, contribute to discussions, and be part of the Community! Sign Up....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I agree with @Lee-W , I think the current pattern is flexible enough. If you go on the route to support each extension (which is an endless route), it will become a huge burden to maintain. We’d like the tool to remain as general as possible and support any file. A possible regex that solves this could be:
Which would match this toml properly:
In my experience most of the time doing
^version
has been enough, and I haven’t used check-consistency much.I do agree the
check-consistency
is problematic for this case. But in a way if you havecommitizen
andpoetry
under the sametoml
and your regex ispyproject.toml:^version
, the regex pattern will pick any of the present words, because that’s what we are telling it to do. I think one option is to use.cz.toml
or go for a stronger regex.This sounds to be a great solution. But I’m a bit worried about the maintenance cost and inconsistency between each format. @woile What do you think?