|
|
Created:
6 years, 8 months ago by iannucci Modified:
6 years, 8 months ago CC:
chromium-reviews Base URL:
https://chromium.googlesource.com/chromium/src.git@git-svn Visibility:
Public. |
DescriptionAdd simple PRESUBMIT check to ensure that all files ending with .json can
be loaded as json.
R=jochen@chromium.org, maruel@chromium.org
BUG=366395
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=265881
Patch Set 1 #
Total comments: 5
Patch Set 2 : fix comments #Messages
Total messages: 26 (0 generated)
PTAL :)
https://codereview.chromium.org/258473002/diff/1/PRESUBMIT.py File PRESUBMIT.py (right): https://codereview.chromium.org/258473002/diff/1/PRESUBMIT.py#newcode12 PRESUBMIT.py:12: import json not needed https://codereview.chromium.org/258473002/diff/1/PRESUBMIT.py#newcode1069 PRESUBMIT.py:1069: for fpath in input_api.AffectedFiles(file_filter= file_filter): remove space https://codereview.chromium.org/258473002/diff/1/PRESUBMIT.py#newcode1072 PRESUBMIT.py:1072: json.load(f) input_api.json.load(f)
PTAL https://chromiumcodereview.appspot.com/258473002/diff/1/PRESUBMIT.py File PRESUBMIT.py (right): https://chromiumcodereview.appspot.com/258473002/diff/1/PRESUBMIT.py#newcode1069 PRESUBMIT.py:1069: for fpath in input_api.AffectedFiles(file_filter= file_filter): On 2014/04/24 00:32:50, M-A Ruel wrote: > remove space Oops, Done. https://chromiumcodereview.appspot.com/258473002/diff/1/PRESUBMIT.py#newcode1072 PRESUBMIT.py:1072: json.load(f) On 2014/04/24 00:32:50, M-A Ruel wrote: > input_api.json.load(f) Done.
lgtm
The CQ bit was checked by iannucci@chromium.org
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/iannucci@chromium.org/258473002/20001
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: tryserver.chromium on chromium_presubmit
The CQ bit was checked by iannucci@chromium.org
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/iannucci@chromium.org/258473002/20001
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: tryserver.chromium on win_chromium_rel
The CQ bit was checked by iannucci@chromium.org
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/iannucci@chromium.org/258473002/20001
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: tryserver.chromium on win_chromium_rel
The CQ bit was checked by iannucci@chromium.org
The CQ bit was unchecked by iannucci@chromium.org
The CQ bit was checked by iannucci@chromium.org
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/iannucci@chromium.org/258473002/20001
The CQ bit was unchecked by iannucci@chromium.org
The CQ bit was checked by iannucci@chromium.org
Message was sent while issue was closed.
Change committed as 265881
Message was sent while issue was closed.
I tripped over this change today because it doesn't deal with comments in the JSON (e.g. copyright headers). So, for example, any changes to chrome/common/extensions/_api_features.json is treated as invalid. In practice, these comments are stripped out by a JSON preprocessor (see JSONParser::EatWhitespaceAndComments in C++, or json_comment_eater.py in python). I have this pending CL which I think handles it better, and includes unit tests: https://codereview.chromium.org/239283008/
Message was sent while issue was closed.
A revert of this CL has been created in https://codereview.chromium.org/251443005/ by yoz@chromium.org. The reason for reverting is: This presubmit rejects existing .json files in the tree that contain comments. (It also doesn't provide enough information about where the json is invalid.). |