From 7ef9d00ad3eadc13664ddb0bbf7fda1377967934 Mon Sep 17 00:00:00 2001 From: Étienne Deparis Date: Sat, 10 Oct 2020 13:32:50 +0200 Subject: feat(git-hooks): Do not take comment lines into account --- git-hooks/git-commit-msg.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/git-hooks/git-commit-msg.rb b/git-hooks/git-commit-msg.rb index bf8774a..86f2eb2 100755 --- a/git-hooks/git-commit-msg.rb +++ b/git-hooks/git-commit-msg.rb @@ -16,6 +16,7 @@ class CommitMsgChecker # rubocop:disable Metrics/ClassLength @warnings = [] @lines = File.readlines(msg) @summary = parse_summary(@lines.shift.strip) + @lines.delete_if { |line| line[0] == '#' } @style = find_git_message_style end -- cgit v1.2.1