silvermine/eslint-config-silvermine

Commitlint: Allow use of `sub` type, and scopes for `sub(feat)` use case

yokuze opened this issue · 1 comments

We've decided to add a new commit type called "sub" for commits that are a part of the implementation for a larger type, such as a feature of fix. For example, if we have a feat that's implemented via 2 separate commits, the git log could look something like this:

ccccccc feat: My new feature
bbbbbbb sub(feat): Add supporting part for my new feature
aaaaaaa sub(feat): Lay the foundation for my new feature

cccccc would be the title of the commit that merges the branch into master.

Additionally, we decided to allow the use of a scope in the sub type so that when a feature, fix, or anything else is implemented by multiple commits, we can designate this using the sub type, but scoped to the main type, such as sub(feat) for a commit that is involved in implementing a particular feature.

Our current commit lint config disallows the use of a "scope" altogether.

Unfortunately there is no configuration setting in commitlint that would allow us to enforce only using a scope with the sub type, so we must disable this rule completely. However, we can use the scope-enum rule to enforce that the scope is only one of our valid types.

Perhaps we should also open an issue (and PR) with commitlint to support enabling the use of "scope" on an enum of types only.

This was fixed with #50