-
Notifications
You must be signed in to change notification settings - Fork 934
Support linting more than the commit message itself #2455
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
Comments
Given that this is fairly domain specific it's likely that a custom plugin would be the way to go. https://commitlint.js.org/#/reference-plugins If you follow the steps under I did have a dummy plugin sitting around a while ago but don't have access to one right now or I would show a simple Proof of Concept. |
As I wrote, would a PR be accepted to add fields to the |
Wouldn't know any reason why not. @armano2 you have any objections to this? |
Apologies I misread that this morning. I think if it's relevant to parsing the commit and it's something trivial to expose for plugin developers then that seems like a good idea to me. |
We've all been there 🤦♂️ but it seems such an addition would not get shut down so I'll try and look into adding this. I've had a quick look over the code base and found the parse logic but it's not super obvious by the 10 min I spent looking where the git commit message are fetched. Do anyone have any pointers on where I would start looking to add this? |
Found where things need to be changed for this to be supported, it seems the I hope I'll have time to add this over the next couple of weeks, kinda swamped at work and this isn't too high on my priority list currently. |
Just had a look into this. I think it's the same as #321 and there's not a lot we can do due to the parser. We can get all the info we need from get-raw-commits but the parser will not parse them without a bit of trickery. There is a possibility of adding them to "notes" by adding something to the parserOptions.noteKeywords then using the format of
I think a good option would be to add it as another check in CI or git pre-commit hook |
I would like to create a plugin for commitlint that would lint the committer/author email to only allow email domains from a list i.e. company emails only and possibly another to make sure commits are signed.
Would a PR that adds some fields to the
parsed
variable in the rules function be welcome?Are there better ways of doing this maybe and it's not interesting to add support for it in commitlint?
The text was updated successfully, but these errors were encountered: