Skip to content

Discussion on check-consistency #595

Open
@gpongelli

Description

@gpongelli

Description

Hi,
I've doubt on how check-consistency flag works.

Steps to reproduce

  1. 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"
  1. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions