mirror of
https://github.com/conventional-commits/conventionalcommits.org.git
synced 2026-03-22 12:44:37 -05:00
Suggestion: sub-typing to handle overlapping types, meta-types and fine-grained scope #135
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Zorvalt on GitHub (Oct 19, 2021).
I am just starting to use Conventional Commits so my idea might be out of scope. Those examples might be inadequate due to my lack of experience, then could it still apply in other cases?
Context
I made a simple change to a build script (responsible for building only a part of the code base) in order to increase readability and maintenance. I splat a list of CFLAGS inside a Makefile in two lists to clarify which flags are required and which are "additional" (debug, etc.).
I was wondering if this should be a
docor abuildchange. I was hesitating between messages similar to:I came to the conclusion that I changed the
doc(type) of thebuildwithin the scopeModuleA. So, in my case, I think thebuildtype is a kind of sub-type.Suggestion
Goal
Allow a reader to understand some ambiguous types or scopes without having to read more than the type/scope part.
Few syntax candidates to illustrate
I thought of the following syntax candidate but my point is not on how to update the grammar but only whether it improves Conventional Commits or not.
doc... impactingbuild(ModuleA)documented thebuildrelative to scopeModuleAbuildrelative to scopedocinModuleAUse cases and reach
What do you think about adding the possibility to specify that? This can cover a lot more such as:
refactorin order tofixfixatestrefactorthecipipelinesperfimprovement in scopeModuleCofrepoBin a monoreporevertafeatOf course, if you
refactorthecipipelines, you refactored and the remainder could go in the description, the body or the footer. The sub-typing does not resolve something impossible but, in my opinion, extends and add clarity to the scope.Sub-typing also allows more fine grained scopes for monorepos by allowing some kind of scope hierarchy, In both of my commit messages compliant with Conventional Commits 1.0.0, someone has to read the description to understand the real scope of my commit. I believe this illustrates a small gap in the scope syntax.
Finally, sub-typing naturally allows meta-types such as:
reverttype whose sub-type would be the reverted typewiptype whose sub-type would be the final type (wip:fix,wip:feat, etc.)Drawbacks
What should be the maximal sub-type depth ?
Maybe I updated the
styleof thedocof thebuildin the scope ofModuleA... and I could go on if I wanted to be creative. I think this would follow the semantics of the angular guidlines but is clearly a worse choice than a type overlap.Meaningless sub-types
Although this could be suppressed by simply applying common sense, sub-typing introduces the possibility to
revertafixorstylearefactor. I think this is not a real concern but I mention it to maybe open the discussion to more concerning issues.Related issues
edit: typos
@jalaziz commented on GitHub (Jan 7, 2022):
I would love to see subtyping and/or support for multiple scopes. We have a monorepo use case and the current standard is too limiting to impart helpful context in some situations, unfortunately.
@fterrani commented on GitHub (Jul 17, 2024):
@Zorvalt I encountered a similar issue when thinking about the hypothetical (or not?)
wiptype. Here are two other syntax ideas: https://github.com/conventional-commits/conventionalcommits.org/issues/38#issuecomment-2223084138