mirror of
https://github.com/github/codeql.git
synced 2026-05-05 21:55:19 +02:00
Python: Autoformat everything using qlformat.
Will need subsequent PRs fixing up test failures (due to deprecated methods moving around), but other than that everything should be straight-forward.
This commit is contained in:
@@ -2,13 +2,13 @@ import python
|
||||
|
||||
from ClassValue cls, string description
|
||||
where
|
||||
cls = ClassValue::bool() and description = "bool"
|
||||
or
|
||||
cls = ClassValue::int_() and description = "int"
|
||||
or
|
||||
cls = ClassValue::float_() and description = "float"
|
||||
or
|
||||
cls = ClassValue::classmethod() and description = "classmethod"
|
||||
or
|
||||
cls = ClassValue::bool().getMro().getItem(2) and description = "object"
|
||||
cls = ClassValue::bool() and description = "bool"
|
||||
or
|
||||
cls = ClassValue::int_() and description = "int"
|
||||
or
|
||||
cls = ClassValue::float_() and description = "float"
|
||||
or
|
||||
cls = ClassValue::classmethod() and description = "classmethod"
|
||||
or
|
||||
cls = ClassValue::bool().getMro().getItem(2) and description = "object"
|
||||
select cls, description
|
||||
|
||||
@@ -2,15 +2,15 @@ import python
|
||||
|
||||
from string txt, Value val
|
||||
where
|
||||
exists(string s |
|
||||
txt = "u'" + s + "'" and val = Value::forUnicode(s)
|
||||
or
|
||||
txt = "b'" + s + "'" and val = Value::forBytes(s)
|
||||
|
|
||||
s = "a" or s = "b" or s = "c" or s = "d"
|
||||
)
|
||||
exists(string s |
|
||||
txt = "u'" + s + "'" and val = Value::forUnicode(s)
|
||||
or
|
||||
exists(int i | txt = i.toString() and val = Value::forInt(i) |
|
||||
i in [1 .. 10] or i in [1000 .. 1010]
|
||||
)
|
||||
txt = "b'" + s + "'" and val = Value::forBytes(s)
|
||||
|
|
||||
s = "a" or s = "b" or s = "c" or s = "d"
|
||||
)
|
||||
or
|
||||
exists(int i | txt = i.toString() and val = Value::forInt(i) |
|
||||
i in [1 .. 10] or i in [1000 .. 1010]
|
||||
)
|
||||
select txt, val
|
||||
|
||||
@@ -2,14 +2,14 @@ import python
|
||||
|
||||
from FunctionValue v, string name
|
||||
where
|
||||
name = v.getQualifiedName() and
|
||||
(
|
||||
v = Value::named("len")
|
||||
or
|
||||
v instanceof PythonFunctionValue
|
||||
or
|
||||
v = Value::named("sys.exit")
|
||||
or
|
||||
v = Value::named("list").(ClassValue).lookup("append")
|
||||
)
|
||||
name = v.getQualifiedName() and
|
||||
(
|
||||
v = Value::named("len")
|
||||
or
|
||||
v instanceof PythonFunctionValue
|
||||
or
|
||||
v = Value::named("sys.exit")
|
||||
or
|
||||
v = Value::named("list").(ClassValue).lookup("append")
|
||||
)
|
||||
select v, name
|
||||
|
||||
@@ -2,12 +2,12 @@ import python
|
||||
|
||||
from Value val, string name
|
||||
where
|
||||
val = Value::named(name) and
|
||||
(
|
||||
name = "bool" or
|
||||
name = "sys" or
|
||||
name = "sys.argv" or
|
||||
name = "ValueError" or
|
||||
name = "slice"
|
||||
)
|
||||
val = Value::named(name) and
|
||||
(
|
||||
name = "bool" or
|
||||
name = "sys" or
|
||||
name = "sys.argv" or
|
||||
name = "ValueError" or
|
||||
name = "slice"
|
||||
)
|
||||
select val, name
|
||||
|
||||
Reference in New Issue
Block a user