-
Notifications
You must be signed in to change notification settings - Fork 913
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update type-empty rule #3047
base: master
Are you sure you want to change the base?
Update type-empty rule #3047
Conversation
Maybe try to start logging things in here: https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/rules/src/type-empty.ts See what you find. Does this help? |
at first sight, the problem would come from the "conventional-commits-parser". Here is its return
|
Hm, I had a look briefly but wasn't sure. What do you think? Won't help with your usecase but at least we're being transparent about what commitlint is trying to achieve/support. |
I agree with you. And indeed it would be transparent so I think we can go for that method |
hey 👋 |
@FelixLgr is this ready? What about the commented out tests? |
I admit I'm not really a fan of adding commented tests (they can be taken as dead code) but actually it's the opposite of what is intuitive. As a reminder, the problem is the following: echo 'Hello world' | commitlint #work (it's normal)
echo ': Hello world' | commitlint #work (not normal, type is `null` and `scope` too) parser return: parsed {
type: null,
scope: null,
subject: 'subject',
merge: null,
header: ': subject',
body: null,
footer: null,
notes: [],
references: [],
mentions: [],
revert: null,
raw: ': subject'
} I'll work on it again to try to solve the problem. I did it a little too fast |
Description
I have tried to improve
type-empty
rule test.Motivation and Context
This PR is necessary to highlight limits posed by the
type-empty
rule (check this issueUsage examples
Types of changes
Checklist:
Notes:
It's the first time I work for a project that is not mine and especially on a library. I only added tests (which may not pass the CI). I'm not sure how everything else works so if I can get some hints or even help I'm not against it.
Issue source : #3036