From 116a3bf1bd5cf6dc6026b5d3f5fd09640f67380e Mon Sep 17 00:00:00 2001 From: Andrew Rynhard Date: Sat, 12 Jan 2019 20:02:42 -0800 Subject: [PATCH] fix(policy): remove commit header length from conventional commit policy (#102) Signed-off-by: Andrew Rynhard --- .../policy/conventionalcommit/conventionalcommit.go | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/internal/policy/conventionalcommit/conventionalcommit.go b/internal/policy/conventionalcommit/conventionalcommit.go index 3b61a879..4a661799 100644 --- a/internal/policy/conventionalcommit/conventionalcommit.go +++ b/internal/policy/conventionalcommit/conventionalcommit.go @@ -17,10 +17,6 @@ type Conventional struct { Scopes []string `mapstructure:"scopes"` } -// MaxNumberOfCommitCharacters is the maximium number of characters allowed in -// a commit header. -const MaxNumberOfCommitCharacters = 72 - // HeaderRegex is the regular expression used for Conventional Commits // 1.0.0-beta.1. var HeaderRegex = regexp.MustCompile(`^(\w*)(\(([^)]+)\))?:\s{1}(.*)($|\n{2})`) @@ -62,7 +58,6 @@ func (c *Conventional) Compliance(options *policy.Options) (report policy.Report return } - ValidateHeaderLength(&report, groups) ValidateType(&report, groups, c.Types) ValidateScope(&report, groups, c.Scopes) ValidateDescription(&report, groups) @@ -70,13 +65,6 @@ func (c *Conventional) Compliance(options *policy.Options) (report policy.Report return report } -// ValidateHeaderLength checks the header length. -func ValidateHeaderLength(report *policy.Report, groups []string) { - if len(groups[0]) > MaxNumberOfCommitCharacters { - report.Errors = append(report.Errors, errors.Errorf("Commit header is %d characters", len(groups[0]))) - } -} - // ValidateType returns the commit type. func ValidateType(report *policy.Report, groups []string, types []string) { types = append(types, TypeFeat, TypeFix)