mirror of
https://github.com/github/codeql.git
synced 2026-04-27 17:55:19 +02:00
QL: use negative char classes to generalize query to detect e.g. underscores
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user