Skip to content

Should .cz.toml actually include the tool table? #1114

Closed

Description

@paduszyk

Description

I like that the commitizen can be configured via the tool-specific file like .cz.toml.

The configuration is based on the tool root table, e.g.:

[tool.commitizen]
name = "cz_customize"

[tool.commitizen.customize]
# ...

what corresponds to the convention used in pyproject.toml - i.e. the same piece of config as the one above can be copy-pasted directly to pyproject.toml without any updates. That's cool.

I think, however, that the config in .cz.toml should not be based on the tool table, because this may suggest (somewhat) that the file is not entirely commitizen-specific.

Therefore, I would go simply with:

name = "cz_customize"

[customize]
# ...

or

[commitizen]
name = "cz_customize"

[commitizen.customize]
# ...

Of course, one can avoid a breaking change by making this optional.

Possible Solution

References to [tool.commitizen] are found in commitizen.config.toml_config module. Thus, any changes should involve updating the methods of the TomlConfig class.

Additional context

No response

Additional context

There are some Python tools using this approach, e.g.:

The last two of them use INI format, however.

Activity

  1. Lee-W commented on May 15, 2024

    @Lee-W
    Member

    Thanks for opening this issue. Sounds valid to me but could potentially be a breaking change. maybe we could change it in v4. @woile @noirbizarre what do you think?

  2. woile commented on May 15, 2024

    @woile
    Member

    Personally I like being able to copy-paste, and it's feels like opening the window for a whole new set of bugs for very little in return

  3. Lee-W commented on May 16, 2024

    @Lee-W
    Member

    I don't have a strong opinion on this one. But if we have an objection from the maintainer, I think we probably won't change this. I'll keep it for a few days before closing it. @paduszyk @noirbizarre please let us know if you have any thought 🙂

  4. paduszyk commented on May 16, 2024

    @paduszyk
    ContributorAuthor

    @Lee-W Thanks for considering it anyway 🙂

  5. Lee-W commented on May 17, 2024

    @Lee-W
    Member

    I'll close it for now and mark it as won't fix till we have a solid rationale to do so. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions