Skip to content

Commit

Permalink
Tolerate lower case input in add-check
Browse files Browse the repository at this point in the history
Signed-off-by: Eric Chlebek <eric@sensu.io>
  • Loading branch information
echlebek authored and dominikh committed Dec 13, 2023
1 parent aef76f4 commit 0c75177
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions add-check.go
Expand Up @@ -61,14 +61,14 @@ func main() {
}

name := os.Args[1]
checkRe := regexp.MustCompile(`^([A-Z]+)\d{4}$`)
checkRe := regexp.MustCompile(`^([A-Za-z]+)\d{4}$`)
parts := checkRe.FindStringSubmatch(name)
if parts == nil {
log.Fatalf("invalid check name %q", name)
}

var catDir string
prefix := parts[1]
prefix := strings.ToUpper(parts[1])
switch prefix {
case "SA":
catDir = "staticcheck"
Expand Down

0 comments on commit 0c75177

Please sign in to comment.