Skip to content
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

Optional parts like body, footer #18

Closed
calipee opened this issue Sep 22, 2023 · 2 comments
Closed

Optional parts like body, footer #18

calipee opened this issue Sep 22, 2023 · 2 comments

Comments

@calipee
Copy link

calipee commented Sep 22, 2023

Hi,

is it possible to set rules for optional parts?

For example it should be optional to add a body, but if a body is added body-leading-blank should be enforced.

When I tried setting this up there is always an error when there is no body.

@calipee
Copy link
Author

calipee commented Sep 25, 2023

I believe it's currently not possible.
I've created a fork, where I added to option to make rules optional when the corresponding part doesn't exist.

This is a really hacky solution but it works for now.
I won't open a pull requests but maybe it could be used as an inspiration to implement this feature properly.

calipee added a commit to calipee/commitlint that referenced this issue Sep 25, 2023
Make it possible to set rules as optional in config

hyiso#18
calipee added a commit to calipee/commitlint that referenced this issue Sep 25, 2023
Make it possible to set rules as optional in config

hyiso#18
calipee added a commit to calipee/commitlint that referenced this issue Sep 25, 2023
Make it possible to set rules as optional in config

hyiso#18
@hyiso
Copy link
Owner

hyiso commented Oct 5, 2023

This seems to be a bug, leading-blank rule should ignore null body and footer

@hyiso hyiso closed this as completed in c07687e Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants