mirror of
https://github.com/github/codeql.git
synced 2026-04-29 18:55:14 +02:00
Python: Apply autoformat.
This commit is contained in:
@@ -14,18 +14,20 @@
|
||||
import python
|
||||
|
||||
/** Whether name is declared in the __all__ list of this module */
|
||||
predicate declaredInAll(Module m, StrConst name)
|
||||
{
|
||||
exists(Assign a, GlobalVariable all |
|
||||
a.defines(all) and a.getScope() = m and
|
||||
all.getId() = "__all__" and ((List)a.getValue()).getAnElt() = name
|
||||
predicate declaredInAll(Module m, StrConst name) {
|
||||
exists(Assign a, GlobalVariable all |
|
||||
a.defines(all) and
|
||||
a.getScope() = m and
|
||||
all.getId() = "__all__" and
|
||||
a.getValue().(List).getAnElt() = name
|
||||
)
|
||||
}
|
||||
|
||||
predicate mutates_globals(ModuleValue m) {
|
||||
exists(CallNode globals |
|
||||
globals = Object::builtin("globals").(FunctionObject).getACall() and
|
||||
globals.getScope() = m.getScope() |
|
||||
globals.getScope() = m.getScope()
|
||||
|
|
||||
exists(AttrNode attr | attr.getObject() = globals)
|
||||
or
|
||||
exists(SubscriptNode sub | sub.getValue() = globals and sub.isStore())
|
||||
@@ -33,9 +35,7 @@ predicate mutates_globals(ModuleValue m) {
|
||||
or
|
||||
exists(Object enum_convert |
|
||||
enum_convert.hasLongName("enum.Enum._convert") and
|
||||
exists(CallNode call |
|
||||
call.getScope() = m.getScope()
|
||||
|
|
||||
exists(CallNode call | call.getScope() = m.getScope() |
|
||||
enum_convert.(FunctionObject).getACall() = call or
|
||||
call.getFunction().refersTo(enum_convert)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user