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 <[email protected]>
  • Loading branch information
echlebek committed Dec 13, 2023
1 parent aef76f4 commit 278dbab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions add-check.go
Original file line number Diff line number Diff line change
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 278dbab

Please sign in to comment.