summaryrefslogtreecommitdiffstats
path: root/PRESUBMIT.py
diff options
context:
space:
mode:
authoryoz@chromium.org <yoz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-25 15:15:29 +0000
committeryoz@chromium.org <yoz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-25 15:15:29 +0000
commit63b1d4d0e7392e3d253013b01e6edb290284c488 (patch)
tree781c11486359ea39408a0c4530c45c06a364cc2a /PRESUBMIT.py
parent504bf75c9cad36b52d06b5f5340fab73a6ddf275 (diff)
downloadchromium_src-63b1d4d0e7392e3d253013b01e6edb290284c488.zip
chromium_src-63b1d4d0e7392e3d253013b01e6edb290284c488.tar.gz
chromium_src-63b1d4d0e7392e3d253013b01e6edb290284c488.tar.bz2
Revert 265881 - "Add simple PRESUBMIT check to ensure that all files ending with .json can"
Revert 266019 - "Add detail to 'invalid JSON' message in PRESUBMIT.py." This presubmit check is invalid - it fails on existing .json files in the tree that contain comments. (Other JSON-reading tools strip out these comments.) Any changes to these .json files are incorrectly rejected by this check. BUG=366395 TBR=iannucci@chromium.org,tnagel@chromium.org Review URL: https://codereview.chromium.org/252713003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@266191 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'PRESUBMIT.py')
-rw-r--r--PRESUBMIT.py16
1 files changed, 0 insertions, 16 deletions
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index 3c1b7ff..67d5578 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -1062,21 +1062,6 @@ def _CheckUserActionUpdate(input_api, output_api):
return []
-def _CheckJSONParsability(input_api, output_api):
- results = []
- file_filter = lambda f: f.LocalPath().endswith('.json')
- for fpath in input_api.AffectedFiles(file_filter=file_filter):
- with open(fpath.LocalPath(), 'r') as f:
- try:
- input_api.json.load(f)
- except ValueError as e:
- results.append(output_api.PresubmitError(
- "File %r does not parse as valid JSON:\n %s"
- % (fpath.LocalPath(), e.args[0])
- ))
- return results
-
-
def _CheckJavaStyle(input_api, output_api):
"""Runs checkstyle on changed java files and returns errors if any exist."""
original_sys_path = sys.path
@@ -1127,7 +1112,6 @@ def _CommonChecks(input_api, output_api):
results.extend(_CheckForAnonymousVariables(input_api, output_api))
results.extend(_CheckCygwinShell(input_api, output_api))
results.extend(_CheckUserActionUpdate(input_api, output_api))
- results.extend(_CheckJSONParsability(input_api, output_api))
if any('PRESUBMIT.py' == f.LocalPath() for f in input_api.AffectedFiles()):
results.extend(input_api.canned_checks.RunUnitTestsInDirectory(