Skip to content

Commit 93fcfc3

Browse files
committed
QL: use negative char classes to generalize query to detect e.g. underscores
1 parent 689f3c0 commit 93fcfc3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ql/ql/src/queries/style/NoUppercaseVariables.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ from string name, AstNode node, string message, string kind
3131
where
3232
(
3333
shouldBeLowerCase(node, name, kind) and
34-
name.regexpMatch("[A-Z].*") and
34+
name.regexpMatch("[^a-z].*") and
3535
message = "lowercase"
3636
or
3737
shouldBeUpperCase(node, name, kind) and
38-
name.regexpMatch("[a-z].*") and
38+
name.regexpMatch("[^A-Z].*") and
3939
message = "uppercase"
4040
) and
4141
not node.hasAnnotation("deprecated")

0 commit comments

Comments
 (0)