question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"footer-empty" rule does not recognize footer

See original GitHub issue

I’m trying to use the footer-empty rule fined in the documentation but it seems to be erroneously flagging my footer as not present.

Expected Behavior

This is my configuration:

const Configuration = {
  /*
   * Resolve and load @commitlint/config-conventional from node_modules.
   * Referenced packages must be installed
   */
  extends: ["@commitlint/config-conventional"],
  /*
   * Any rules defined here will override rules from @commitlint/config-conventional
   */
  rules: {
    "footer-empty": [2, "never"],
  },
};

module.exports = Configuration;

As a result, I expected this commit to work:

chore: testing footer lint

footer: I expect this to work
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch add_commit_linter
# Changes to be committed:
#       modified:   commitlint.config.js
#

Current Behavior

Currently, I get this error when I commit the code:

commitlint...............................................................Failed
- hook id: commitlint
- duration: 0.39s
- exit code: 1

⧗   input: chore: testing footer lint

footer: I expect this to work
✖   footer may not be empty [footer-empty]
✖   found 1 problems, 0 warnings 
    (Need help? -> https://github.com/conventional-changelog/commitlint#what-is-commitlint )

My Environment

Executable Version
commitlint --version @commitlint/cli": "^16.2.1"
git --version git version 2.32.0 (Apple Git-132)
node --version Node.js v17.5.0

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
bimawacommented, Apr 25, 2022

Hmm footer not parsed if we use yarn commitlint -g ./commitlint.config.js --edit $1 line in file commit-msg. But it works if we use cat $1 | yarn commitlint -g ./commitlint.config.js instead. Maybe it’s help to dig it.

1reaction
jaklancommented, Apr 19, 2022

Also noticed the same behaviour when I allow empty body, but not allow empty footer. Then:

test(general): some change

Issue: #1

fails, because Issue: #1 seems to be treated as body.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Accessing a header or footer creates it, but leaving an empty ...
My problem is that accessing a header or footer in any way seems to create it (a paragraph mark gets shown) but leaving...
Read more >
HOW to keep your FOOTER at the bottom of the page with CSS
I explain how to keep your footer element stuck to the bottom of the page with CSS. The problem occurs when you have...
Read more >
Footer does not show up when including pdfs to document - TeX
I am trying to include a footer on each page that would link to the table of contents but this footer ("Contents") does...
Read more >
Why can't I select and change the text in the footer?
Solution: If you can't directly edit footer text, it's probably the case that the footer placeholder has been turned off in Slide Master...
Read more >
How To Edit the Footer in WordPress Using Every Method ...
Although not as visited as the header, the footer is still ... You'll most likely see an empty menu page with several buttons...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found