Skip to content

Commit

Permalink
feat(policy): show valid types and scopes on error (siderolabs#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewrynhard authored Oct 16, 2018
1 parent 954c003 commit d65491a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/policy/conventionalcommit/conventionalcommit.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func ValidateType(report *policy.Report, groups []string, types []string) {
return
}
}
report.Errors = append(report.Errors, fmt.Errorf("Invalid type: %s", groups[1]))
report.Errors = append(report.Errors, fmt.Errorf("Invalid type: %s, allowed types are: %v", groups[1], types))
}

// ValidateScope returns the commit scope.
Expand All @@ -103,7 +103,7 @@ func ValidateScope(report *policy.Report, groups []string, scopes []string) {
return
}
}
report.Errors = append(report.Errors, fmt.Errorf("Invalid scope: %s", groups[3]))
report.Errors = append(report.Errors, fmt.Errorf("Invalid scope: %s, allowed scopes are: %v", groups[3], scopes))
}

// ValidateDescription returns the commit description.
Expand Down

0 comments on commit d65491a

Please sign in to comment.