Skip to content

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

Closed
@paduszyk

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.

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