Closed JensRantil closed 5 years ago
@JensRantil What do you think of this: if scopes ==nil || len(scopes) == 0; then don't enforce scopes
?
Actually, it looks like we already allow this. Scopes are completely optional, its just implicit. Simply don't set scopes
in .conform.yaml
.
@JensRantil I'm going to close this since this can be achieved by not specifying a scope
in .conform.yaml
. Appreciate your time.
Hi @andrewrynhard ,
Not setting scopes
in .conform.yaml
is making Conventional Commits check fail with invalid scope on master (007644608):
policies:
- type: commit
spec:
headerLength: 89
dco: true
gpg: false
imperative: true
maximumOfOneCommit: false
requireCommitBody: true
conventional:
types:
- fix
- feat
- build
- ci
- docs
- style
- refactor
- perf
- test
../conform/conform enforce
POLICY CHECK STATUS MESSAGE
commit Header Length PASS <none>
commit DCO PASS <none>
commit Imperative Mood PASS <none>
commit Conventional Commit FAILED Invalid scope "gh-actions": allowed scopes are []
commit Commit Body PASS <none>
Maybe a regression?
@JensRantil @jwnx Looks like I was completely wrong. Scopes are indeed optional, but when a scope is present they are being enforced. Sorry for the mixup here. @JensRantil If you still wish to get this PR in, then that would fix this. If not I can fix. I can't promise it would happen soon.
Late answer here, sorry - we built our own in-house commit message linter instead. As such, I will not have time to wrap this up. Feel free to continue the work I started.
We have a very large repository where scope can't be enforced. This commit makes whitelisted scopes optional.
Side-note: I've always understood (based on [1]) scope to be more of a free-text field than something whitelisted/enumerated.
[1] https://www.conventionalcommits.org/en/v1.0.0-beta.4/