Skip to content

Commit

Permalink
rules: strict using lower cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Yeuoly committed Nov 7, 2024
1 parent 70351d4 commit 115a5ce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/commandline/init/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ""
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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})?$`)
)

Expand Down

0 comments on commit 115a5ce

Please sign in to comment.