Skip to content

Commit 9c1ca3b

Browse files
committed
fix: use raw commit message to check for leading blank line
1 parent fd97051 commit 9c1ca3b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

source/rules/body-leading-blank.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
export default (parsed, when) => {
22
const negated = when === 'never';
3-
const lines = (parsed.body || '').split('\n');
4-
console.log(parsed);
5-
console.log(lines);
3+
// get complete body split into lines
4+
const lines = (parsed.raw || '').split('\n').slice(1);
5+
// check if the first line of body (if any) is empty
66
const leadingBlank =
77
lines.length > 0 ?
88
lines[0].length === 0 :
99
true;
10-
console.log(leadingBlank);
1110
return [
1211
negated ? !leadingBlank : leadingBlank,
1312
[

0 commit comments

Comments
 (0)