`body-max-line-length` should not report false positives for line starts with `#`
See original GitHub issueExpected Behavior
body-max-line-length
should not report false positives for line starts with #
Current Behavior
body-max-line-length
report false positives for line starts with #
While debuging in the node_modules/@commitlint/rules/lib/body-max-line-length.js
I found parsed.body
have the following value as follows:
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch chore/sync-remote-config2
# Your branch is up to date with 'origin/chore/sync-remote-config2'.
#
# Changes to be committed:
# modified: packages/code-standard-cli/package.json
# new file: packages/xxx/src/_private/yyyy/diffConfig.ts
# renamed: packages/xxx/src/_private/yyyy/foo/bar.ts -> packages/xxx/src/_private/yyyy/foo/barabcdefg.ts
#
Obviously, the lines come from the git commit
command line, and should be ignored as they starts with #
Affected packages
- cli
- core
- prompt
- config-angular
Possible Solution
Steps to Reproduce (for bugs)
- First step
- Second step
commitlint.config.js
```js ```Context
Your Environment
Executable | Version |
---|---|
commitlint --version |
VERSION |
git --version |
VERSION |
node --version |
VERSION |
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (4 by maintainers)
Top Results From Across the Web
Example Responses to False Positives in a Security Review ...
The following example shows how to document your responses to false positives listed in a Salesforce security review failure report. It's written to...
Read more >Mark as False Positives - Knowledge Base - Outpost24
Go to Main Menu > Netsec > Reporting Tools. Select a group in Target Group. In the Findings tab, select the finding to...
Read more >Diff - TF-A/trusted-firmware-a - Gitiles
In this case, 4096 is greater than 32, so the L0 +tables must be aligned to 4096 bytes. + +Sample calculation for L1...
Read more >Vulnerability Scan Reports: Tired of Marking False Positives?
For unauthenticated scans, do not provide critical information such as software or kernel versions. Know what information is returned from ...
Read more >debian-packaging: gitlint - Progress Linux
+- If you're looking to contribute code to gitlint, please start here: ... + title-must-not-contain-word, body-max-line-length, body-trailing-whitespace, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Should be fixed with 16.1.0.
@xboy2012 please give it a try and close this this issue if it works. Thanks.
@Zirak thanks for your PR!
From my understanding @xboy2012, that logic isn’t reached. Since earlier in the function there’s a check which filters out all non-objects, no matter what function is passed in the result is
undefined
:It applies to passing in an object with a
parserOpts
function and a certain name, like:As I mentioned above, function support could be added by conditionally checking for passing in functions earlier in the code, and dealing with that there. If there’s interest I can draw up a PR.