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

Unified Diff: PRESUBMIT.py

Issue 682493002: Remove the dependency on json schema compiler. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 2 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 | « .gitignore ('k') | build/json_schema_api.gni » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: PRESUBMIT.py
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index 799c5346300e9ec6d6395ef8a60f70355af2d5fe..1f2067ddbfa81096f87d4d886788b05ed19617de 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -1117,28 +1117,9 @@ def _GetJSONParseError(input_api, filename, eat_comments=True):
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 @@ def _CheckParseErrors(input_api, output_api):
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 @@ def _CheckParseErrors(input_api, output_api):
if MatchesFile(excluded_patterns, path):
return False
-
- if (action == _GetIDLParseError and
- not MatchesFile(idl_included_patterns, path)):
- return False
return True
results = []
« no previous file with comments | « .gitignore ('k') | build/json_schema_api.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698