Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b927588

Browse files
author
Benjamin Muskalla
committed
Auto-format generated qll files
1 parent e2bd792 commit b927588

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

java/ql/src/utils/model-generator/GenerateFlowModel.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
def printHelp():
1313
print("""Usage:
14-
GenerateFlowModel.py <library-database> "simpleName" [--with-sinks] [--with-sources] [--with-summaries]
14+
GenerateFlowModel.py <library-database> <simpleName> [--with-sinks] [--with-sources] [--with-summaries]
1515
1616
This generates summary, source and sink models for the code in the database.
1717
The files will be placed in `java/ql/lib/semmle/code/java/frameworks/generated/<simpleName>/`
@@ -159,5 +159,11 @@ def asCsvModel(superclass, kind, rows):
159159
with open(frameworkTarget, "w") as frameworkQll:
160160
frameworkQll.write(qllContents)
161161

162+
cmd = ['codeql', 'query', 'format', '--in-place', frameworkTarget]
163+
ret = subprocess.call(cmd)
164+
if ret != 0:
165+
print("Failed to format query. Failed command was: " + shlex.join(cmd))
166+
sys.exit(1)
167+
162168
print("")
163169
print("CSV model written to " + frameworkTarget)

0 commit comments

Comments
 (0)