Skip to content

Commit 5211c2a

Browse files
authored
Alphanumeric name check: Don't use \w, because we don't want it include underscores
1 parent 63a13b6 commit 5211c2a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/AutoMerge/guidelines.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,10 @@ const guideline_normal_capitalization = Guideline(;
384384
)
385385

386386
function meets_normal_capitalization(pkg)
387-
meets_this_guideline = occursin(r"^[A-Z]\w*[a-z]\w*[0-9]?$", pkg)
387+
# We intentionally do not use `\w` in this regex.
388+
# `\w` includes underscores, but we don't want to include underscores.
389+
# So, instead of `\w`, we use `[A-Za-z0-9]`.
390+
meets_this_guideline = occursin(r"^[A-Z][A-Za-z0-9]*[a-z][A-Za-z0-9]*[0-9]?$", pkg)
388391
if meets_this_guideline
389392
return true, ""
390393
else

0 commit comments

Comments
 (0)