conventional-changelog-archived-repos / validate-commit-msg

DEPRECATED. Use https://github.com/marionebl/commitlint instead. githook to validate commit messages are up to standard
http://conventionalcommits.org/
MIT License
557 stars 100 forks source link

fix(scope): Allow no scope in the commit message when validate is set to true. #69

Closed yeelan0319 closed 7 years ago

yeelan0319 commented 7 years ago

When validate: true, it should allow the user provided no scope. Commit message such as chore: Publish should pass.

However, the current setup tries to call multiple method on undefined in that situation. So I fixed that by adding scope.length > 0 before validate any individual message.

codecov-io commented 7 years ago

Codecov Report

Merging #69 into master will not change coverage. The diff coverage is 100%.

@@          Coverage Diff          @@
##           master    #69   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           3      3           
  Lines         121    123    +2     
=====================================
+ Hits          121    123    +2
Impacted Files Coverage Δ
lib/validateMessage.js 100% <100%> (ø) :white_check_mark:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update b737246...4abbb72. Read the comment docs.

yeelan0319 commented 7 years ago

Please take a look again and see if this is good. Thanks! 😃

kentcdodds commented 7 years ago

Thanks @yeelan0319!