зеркало из https://github.com/github/codeql.git
Swift: remove `ql.internal` classes from global import
This commit is contained in:
Родитель
48825442c3
Коммит
b22da25e05
|
@ -327,7 +327,8 @@ def generate(opts, renderer):
|
|||
renderer.render(stub, stub_file)
|
||||
|
||||
# for example path/to/elements -> path/to/elements.qll
|
||||
renderer.render(ql.ImportList(list(imports.values())), include_file)
|
||||
renderer.render(ql.ImportList([i for name, i in imports.items() if not classes[name].ql_internal]),
|
||||
include_file)
|
||||
|
||||
renderer.render(ql.GetParentImplementation(list(classes.values())), out / 'ParentChild.qll')
|
||||
|
||||
|
|
|
@ -100,6 +100,7 @@ class Class:
|
|||
qltest_skip: bool = False
|
||||
qltest_collapse_hierarchy: bool = False
|
||||
qltest_uncollapse_hierarchy: bool = False
|
||||
ql_internal: bool = False
|
||||
ipa: bool = False
|
||||
doc: List[str] = field(default_factory=list)
|
||||
|
||||
|
|
|
@ -170,6 +170,15 @@ def test_hierarchy_imports(generate_import_list):
|
|||
]) == ql.ImportList([stub_import_prefix + cls for cls in "ABCD"])
|
||||
|
||||
|
||||
def test_internal_not_in_import_list(generate_import_list):
|
||||
assert generate_import_list([
|
||||
schema.Class("D", bases=["B", "C"]),
|
||||
schema.Class("C", bases=["A"], derived={"D"}, pragmas=["ql_internal"]),
|
||||
schema.Class("B", bases=["A"], derived={"D"}),
|
||||
schema.Class("A", derived={"B", "C"}, pragmas=["ql_internal"]),
|
||||
]) == ql.ImportList([stub_import_prefix + cls for cls in "BD"])
|
||||
|
||||
|
||||
def test_hierarchy_children(generate_children_implementations):
|
||||
assert generate_children_implementations([
|
||||
schema.Class("A", derived={"B", "C"}),
|
||||
|
|
Загрузка…
Ссылка в новой задаче