Pārlūkot izejas kodu

rules: strict using lower cases

Yeuoly 9 mēneši atpakaļ
vecāks
revīzija
115a5ce2f0

+ 3 - 0
cmd/commandline/init/profile.go

@@ -64,6 +64,9 @@ func (p *profile) checkRule() bool {
 	} else if p.cursor == 0 && !plugin_entities.PluginNameRegex.MatchString(p.inputs[p.cursor].Value()) {
 		p.warning = "Plugin name must be 1-128 characters long, and can only contain letters, numbers, dashes and underscores"
 		return false
+	} else if p.cursor == 1 && !plugin_entities.AuthorRegex.MatchString(p.inputs[p.cursor].Value()) {
+		p.warning = "Author name must be 1-64 characters long, and can only contain letters, numbers, dashes and underscores"
+		return false
 	} else {
 		p.warning = ""
 	}

+ 1 - 0
internal/types/entities/plugin_entities/plugin_declaration.go

@@ -261,6 +261,7 @@ func (p *PluginDeclaration) MarshalJSON() ([]byte, error) {
 
 var (
 	PluginNameRegex               = regexp.MustCompile(`^[a-z0-9_-]{1,128}$`)
+	AuthorRegex                   = regexp.MustCompile(`^[a-z0-9_-]{1,64}$`)
 	PluginDeclarationVersionRegex = regexp.MustCompile(`^\d{1,4}(\.\d{1,4}){1,3}(-\w{1,16})?$`)
 )