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

bug: footer-leading-blank always triggers when comment in body #3120

Closed
1 task done
wtho opened this issue Apr 13, 2022 · 2 comments · Fixed by #3139
Closed
1 task done

bug: footer-leading-blank always triggers when comment in body #3120

wtho opened this issue Apr 13, 2022 · 2 comments · Fixed by #3139

Comments

@wtho
Copy link
Contributor

wtho commented Apr 13, 2022

footer-leading-blank complains when comment in body

Example Commit Message

fix: failing example

body line 1
# comment in body breaks footer-leading-blank - uncomment to remove the error
body line 2

fixes #123

Try it out

This bug seems to differ from #896

Expected Behavior

The rule should locate the body lines properly and not think there is content between body and footer.

Current Behavior

The footer-leading-blank rule counts the body lines excluding the comments and then compares them to the raw input, which in turn contains the comments.

Affected packages

  • @commitlint/rules and all packages using it

Possible Solutions

Bug is in footer-leading-blank.ts

  • Correctly count the raw length of bodyLines in or
  • Remove comment lines from rawLines before slicing

Steps to Reproduce (for bugs)

See message or link at the top of the issue

Your Environment

Executable Version
commitlint --version 16.2.3
git --version 2.35.1
node --version 16.14.2
@escapedcat
Copy link
Member

Thanks for opening this!
Would you have time and motivation to dig into it and create a PR for this?

@wtho
Copy link
Contributor Author

wtho commented Apr 20, 2022

Sure! Will do so next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

2 participants