Skip to content

Commit bc0a32c

Browse files
committed
Swift: sort import list
Also fix parent tests with updated `statements.swift` file.
1 parent 3597efb commit bc0a32c

File tree

4 files changed

+271
-240
lines changed

4 files changed

+271
-240
lines changed

swift/codegen/generators/qlgen.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,9 @@ def generate(opts, renderer):
116116

117117
# for example path/to/elements -> path/to/elements.qll
118118
include_file = stub_out.with_suffix(".qll")
119-
all_imports = ql.ImportList([v for _, v in sorted(imports.items())])
119+
all_imports = ql.ImportList(list(sorted(imports.values())))
120120
renderer.render(all_imports, include_file)
121121

122-
print(include_file)
123122
renderer.render(ql.GetParentImplementation(classes=classes, imports=[get_import(include_file, opts.swift_dir)]),
124123
out / 'GetImmediateParent.qll')
125124

swift/codegen/test/test_qlgen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,8 @@ def test_class_dir_imports(opts, input, renderer):
264264
schema.Class("B", bases={"A"}),
265265
]
266266
assert generate_import_list(opts, renderer) == ql.ImportList([
267-
stub_import_prefix + "another.rel.path.A",
268267
stub_import_prefix + "B",
268+
stub_import_prefix + "another.rel.path.A",
269269
])
270270

271271

0 commit comments

Comments
 (0)