Remove the dependency on json schema compiler.
BUG=None
TEST=None
R=jamesr@chromium.org
Review URL: https://codereview.chromium.org/682493002
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index 799c534..1f2067d 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -1117,28 +1117,9 @@
return None
-def _GetIDLParseError(input_api, filename):
- try:
- contents = input_api.ReadFile(filename)
- idl_schema = input_api.os_path.join(
- input_api.PresubmitLocalPath(),
- 'tools', 'json_schema_compiler', 'idl_schema.py')
- process = input_api.subprocess.Popen(
- [input_api.python_executable, idl_schema],
- stdin=input_api.subprocess.PIPE,
- stdout=input_api.subprocess.PIPE,
- stderr=input_api.subprocess.PIPE,
- universal_newlines=True)
- (_, error) = process.communicate(input=contents)
- return error or None
- except ValueError as e:
- return e
-
-
def _CheckParseErrors(input_api, output_api):
- """Check that IDL and JSON files do not contain syntax errors."""
+ """Check that JSON files do not contain syntax errors."""
actions = {
- '.idl': _GetIDLParseError,
'.json': _GetJSONParseError,
}
# These paths contain test data and other known invalid JSON files.
@@ -1150,11 +1131,6 @@
json_no_comments_patterns = [
r'^testing[\\\/]',
]
- # Only run IDL checker on files in these directories.
- idl_included_patterns = [
- r'^chrome[\\\/]common[\\\/]extensions[\\\/]api[\\\/]',
- r'^extensions[\\\/]common[\\\/]api[\\\/]',
- ]
def get_action(affected_file):
filename = affected_file.LocalPath()
@@ -1174,10 +1150,6 @@
if MatchesFile(excluded_patterns, path):
return False
-
- if (action == _GetIDLParseError and
- not MatchesFile(idl_included_patterns, path)):
- return False
return True
results = []