mirror of
https://github.com/github/codeql.git
synced 2026-04-28 18:25:24 +02:00
Swift: add --ql-format/--no-ql-format to codegen
This commit is contained in:
@@ -15,6 +15,8 @@ def _init_options():
|
||||
Option("--dbscheme", tags=["dbscheme"], type=_abspath, default=paths.swift_dir / "ql/lib/swift.dbscheme")
|
||||
Option("--ql-output", tags=["ql"], type=_abspath, default=paths.swift_dir / "ql/lib/codeql/swift/generated")
|
||||
Option("--ql-stub-output", tags=["ql"], type=_abspath, default=paths.swift_dir / "ql/lib/codeql/swift/elements")
|
||||
Option("--ql-format", tags=["ql"], action="store_true", default=True)
|
||||
Option("--no-ql-format", tags=["ql"], action="store_false", dest="ql_format")
|
||||
Option("--codeql-binary", tags=["ql"], default="codeql")
|
||||
Option("--cpp-output", tags=["cpp"], type=_abspath, required=True)
|
||||
Option("--cpp-namespace", tags=["cpp"], default="codeql")
|
||||
|
||||
@@ -107,7 +107,8 @@ def generate(opts, renderer):
|
||||
renderer.render(all_imports, include_file)
|
||||
|
||||
renderer.cleanup(existing)
|
||||
format(opts.codeql_binary, renderer.written)
|
||||
if opts.ql_format:
|
||||
format(opts.codeql_binary, renderer.written)
|
||||
|
||||
|
||||
tags = ("schema", "ql")
|
||||
|
||||
@@ -23,6 +23,7 @@ gen_import_prefix = "other.path."
|
||||
def generate(opts, renderer, written=None):
|
||||
opts.ql_stub_output = stub_path()
|
||||
opts.ql_output = ql_output_path()
|
||||
opts.ql_format = True
|
||||
renderer.written = written or []
|
||||
return run_generation(qlgen.generate, opts, renderer)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user