Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(344)

Unified Diff: tools/json_schema_compiler/idl_schema.py

Issue 239283008: Add global presubmit that JSON and IDL files can be parsed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/extensions/api/test_presubmit/valid_json.json ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/json_schema_compiler/idl_schema.py
diff --git a/tools/json_schema_compiler/idl_schema.py b/tools/json_schema_compiler/idl_schema.py
index 72e4d13b4fd67c9464343d40f40b6c75d3a1e937..89bb8816b0c82f9237e4f14ca287861c5a036d60 100644
--- a/tools/json_schema_compiler/idl_schema.py
+++ b/tools/json_schema_compiler/idl_schema.py
@@ -469,8 +469,14 @@ def Main():
Dump a json serialization of parse result for the IDL files whose names
were passed in on the command line.
'''
- for filename in sys.argv[1:]:
- schema = Load(filename)
+ if len(sys.argv) > 1:
+ for filename in sys.argv[1:]:
+ schema = Load(filename)
+ print json.dumps(schema, indent=2)
+ else:
+ contents = sys.stdin.read()
+ idl = idl_parser.IDLParser().ParseData(contents, '<stdin>')
+ schema = IDLSchema(idl).process()
print json.dumps(schema, indent=2)
« no previous file with comments | « chrome/common/extensions/api/test_presubmit/valid_json.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698