You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error message on the empty commit
AND
validate as normal
Current Behavior
/Users/foo/src/wis/common/temp/node_modules/.registry.npmjs.org/@commitlint/cli/7.2.1/node_modules/@commitlint/cli/lib/cli.js:109
throw err;
^
TypeError: Expected a raw commit
at parser (/Users/foo/src/wis/common/temp/node_modules/.registry.npmjs.org/conventional-commits-parser/2.1.7/node_modules/conventional-commits-parser/lib/parser.js:79:11)
at sync (/Users/foo/src/wis/common/temp/node_modules/.registry.npmjs.org/conventional-commits-parser/2.1.7/node_modules/conventional-commits-parser/index.js:97:10)
at $If_1 (/Users/foo/src/wis/common/temp/node_modules/.registry.npmjs.org/@commitlint/parse/7.1.2/node_modules/@commitlint/parse/lib/index.js:36:13)
at /Users/foo/src/wis/common/temp/node_modules/.registry.npmjs.org/@commitlint/parse/7.1.2/node_modules/@commitlint/parse/lib/index.js:42:16
at new Promise (<anonymous>)
at parse (/Users/foo/src/wis/common/temp/node_modules/.registry.npmjs.org/@commitlint/parse/7.1.2/node_modules/@commitlint/parse/lib/index.js:19:9)
at Object.<anonymous> (/Users/foo/src/wis/common/temp/node_modules/.registry.npmjs.org/@commitlint/lint/7.2.1/node_modules/@commitlint/lint/lib/index.js:56:45)
at new Promise (<anonymous>)
at exports.default (/Users/foo/src/wis/common/temp/node_modules/.registry.npmjs.org/@commitlint/lint/7.2.1/node_modules/@commitlint/lint/lib/index.js:42:55)
at Promise.resolve.Promise.all.messages.map.message (/Users/foo/src/wis/common/temp/node_modules/.registry.npmjs.org/@commitlint/cli/7.2.1/node_modules/@commitlint/cli/lib/cli.js:149:66)
Steps to Reproduce (for bugs)
git commit --allow-empty -m ""
Context
Your Environment
Mac OS High Sierra
Executable
Version
commitlint --version
7.2.1
git --version
2.19.1
node --version
10.14.0
The text was updated successfully, but these errors were encountered:
But for some reason stdin() returns a \n which doesn't count as an empty message.
I guess checking if inputis a line-break only would work but the nicer way would be to figure out why this used to work (I guess... did it?) and now apparently input is a \n and it stopped working.
Oh wow, nice find! 😄 Ok, so apparently it's expected behavior from Sindre's package get-stdin. The only way I can come up with another solution is the .trim() or even .trimEnd() method. It also trims line breaks, but I'm not sure if it trims too much or has an impact on some rules.
git commit --allow-empty -m ""
Expected Behavior
error message on the empty commit
AND
validate as normal
Current Behavior
Steps to Reproduce (for bugs)
Context
Your Environment
Mac OS High Sierra
commitlint --version
git --version
node --version
The text was updated successfully, but these errors were encountered: