aboutsummaryrefslogtreecommitdiff
path: root/internal/pushrules/validate.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/pushrules/validate.go')
-rw-r--r--internal/pushrules/validate.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/internal/pushrules/validate.go b/internal/pushrules/validate.go
index f50c51bd..b54ec3fb 100644
--- a/internal/pushrules/validate.go
+++ b/internal/pushrules/validate.go
@@ -10,6 +10,10 @@ import (
func ValidateRule(kind Kind, rule *Rule) []error {
var errs []error
+ if len(rule.RuleID) > 0 && rule.RuleID[:1] == "." {
+ errs = append(errs, fmt.Errorf("invalid rule ID: rule can not start with a dot"))
+ }
+
if !validRuleIDRE.MatchString(rule.RuleID) {
errs = append(errs, fmt.Errorf("invalid rule ID: %s", rule.RuleID))
}