Commitizen plugin that prefixes commit messages with the common path or prefix of staged files.
Example with dev group:
poetry add -G dev cz-pathpip install cz-pathPass -n cz_path to cz or add it to your configuration file.
By default, src/ will be removed from any determined prefix. This can be customised by setting
remove_path_prefixes to []. You also may want to add other locations such as a module name.
Adding / is not required.
[tool.commitizen]
name = "cz_path"
remove_path_prefixes = ["src", "module_name"]{
"commitizen": {
"name": "cz_path",
"remove_path_prefixes": ["src", "module_name"]
}
}| Staged files | Path prefix | String prefix |
|---|---|---|
src/a.c, src/b.c |
src |
src/ |
src/a1.c, src/a2.c |
src |
src/a |
a.c, b.c |
(no option) | (no option) |
If no prefix is found amongst the staged files, only the choices project and empty will be given.