You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating a commit be able to identify from where (packages) the files are coming from:
$ git commit -m "feat: adding a new DB adapter for X"# (on packages A)
$ git commit -m "fix: this will solve a problem on the Service Z"# (on packages B)
$ git commit -m "chore: update eslint-config-custom to version 0.4.2"# (on packages A, B, C)
And we format the message given the package/scope they changes are coming from:
ccc64c55 "feat(A): adding a new database adapter for X"
42bc938a "fix(B): this will solve a problem on the Service Z"
9f4fe8d3 "chore: update eslint-config-custom to version 0.4.2"
Current Behavior
When writing a commit we're obligated to define the scope of the package, and to avoid forgetting it we add the rule 'scope-empty': [2, 'never'] to enforce this definition when generating our CHANGELOG file.
The only way now is by always adding the (scope) manually as we couldn't find an easy way to adding it dynamically by detecting from which package the affected files are coming from.
There's an approach we can follow by reading the commit message/title and the staged files?
Exactly @escapedcat, as you can see in the configuration. Furthermore, we're trying to write our own config to see if we can manage to archive it and open-source it later, but no success so far.
I thought you might benefit from my plugin commitlint-plugin-function-rules, but after looking at your issue further I don't think that would work as you want o change the commit message if I understand correctly. Changing the commit message from a rule is currently not possible as far as I know.
You can use it to get the committed files by calling something like git diff --staged --name-only from the function but then you'd need some way to inject it into the commit message, which I don't know. You can, however, use something like this with the function rule to verify that the added scope matches the committed files and create a rule for that.
Expected Behavior
When creating a commit be able to identify from where (packages) the files are coming from:
And we format the message given the package/scope they changes are coming from:
Current Behavior
When writing a commit we're obligated to define the
scope
of the package, and to avoid forgetting it we add the rule'scope-empty': [2, 'never']
to enforce this definition when generating our CHANGELOG file.The only way now is by always adding the
(scope)
manually as we couldn't find an easy way to adding it dynamically by detecting from which package the affected files are coming from.There's an approach we can follow by reading the commit message/title and the staged files?
Current config
commitlint.config.js
The text was updated successfully, but these errors were encountered: