From 44d4ef0256dd48965eabcbeade2838bb9ccdeaea Mon Sep 17 00:00:00 2001 From: Andrew Rynhard Date: Sat, 22 Jul 2017 21:57:20 -0700 Subject: [PATCH] fix(policy): check the entire commit header length (#31) --- pkg/policy/conventionalcommit/conventionalcommit.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/policy/conventionalcommit/conventionalcommit.go b/pkg/policy/conventionalcommit/conventionalcommit.go index 314debbc..afdaaa96 100644 --- a/pkg/policy/conventionalcommit/conventionalcommit.go +++ b/pkg/policy/conventionalcommit/conventionalcommit.go @@ -65,8 +65,8 @@ func (c *Conventional) Tasks(map[string]*task.Task) policy.Option { // ValidateHeaderLength checks the header length. func ValidateHeaderLength(report *policy.Report, groups []string) { - if len(groups[1]) > MaxNumberOfCommitCharacters { - report.Errors = append(report.Errors, fmt.Errorf("Commit header is %d characters", len(groups[1]))) + if len(groups[0]) > MaxNumberOfCommitCharacters { + report.Errors = append(report.Errors, fmt.Errorf("Commit header is %d characters", len(groups[0]))) } }