QL: use negative char classes to generalize query to detect e.g. underscores

This commit is contained in:
Erik Krogh Kristensen
2022-03-14 15:00:27 +01:00
parent 689f3c0478
commit 93fcfc3012

View File

@@ -31,11 +31,11 @@ from string name, AstNode node, string message, string kind
where
(
shouldBeLowerCase(node, name, kind) and
name.regexpMatch("[A-Z].*") and
name.regexpMatch("[^a-z].*") and
message = "lowercase"
or
shouldBeUpperCase(node, name, kind) and
name.regexpMatch("[a-z].*") and
name.regexpMatch("[^A-Z].*") and
message = "uppercase"
) and
not node.hasAnnotation("deprecated")