mirror of
https://github.com/github/codeql.git
synced 2026-04-28 10:15:14 +02:00
QL: recognize the names defined by import as statements
This commit is contained in:
@@ -27,6 +27,8 @@ string getName(AstNode node, string kind) {
|
||||
result = node.(FieldDecl).getName() and kind = "field"
|
||||
or
|
||||
result = node.(Module).getName() and kind = "module"
|
||||
or
|
||||
result = node.(Import).importedAs() and kind = "import"
|
||||
}
|
||||
|
||||
string prettyPluralKind(string kind) {
|
||||
@@ -45,6 +47,8 @@ string prettyPluralKind(string kind) {
|
||||
kind = "field" and result = "fields"
|
||||
or
|
||||
kind = "module" and result = "modules"
|
||||
or
|
||||
kind = "import" and result = "imports"
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -13,7 +13,7 @@ import codeql_ql.style.AcronymsShouldBeCamelCaseQuery as AcronymsQuery
|
||||
|
||||
predicate shouldBeUpperCase(AstNode node, string name, string kind) {
|
||||
name = AcronymsQuery::getName(node, kind) and
|
||||
kind = ["class", "newtypeBranch", "newtype", "module"]
|
||||
kind = ["class", "newtypeBranch", "newtype", "module", "import"]
|
||||
}
|
||||
|
||||
predicate shouldBeLowerCase(AstNode node, string name, string kind) {
|
||||
|
||||
Reference in New Issue
Block a user