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

Issue 6299001: Syntax checker for policy_templates.json (Closed)

Created:
9 years, 11 months ago by Jakob Kummerow
Modified:
9 years, 6 months ago
Reviewers:
gfeher, M-A Ruel, Jói
CC:
chromium-reviews, ceee-reviews_chromium.org, amit
Visibility:
Public.

Description

Syntax checker for policy_templates.json To make sure that all policy definitions match the expected format. The checker is called as a presubmit hook, and can also be invoked manually. Run it without any parameters (or with --help) to get usage information. BUG=69527 TEST=manual: checker reports no errors for correct policy definitions, checker complains for malformed policy definitions, checker is invoked as presubmit hook when policy_templates.json has been changed Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=71778

Patch Set 1 #

Total comments: 10

Patch Set 2 : address comments #

Total comments: 8

Patch Set 3 : address more comments #

Total comments: 8

Patch Set 4 : fix nits; update PRESUBMIT.py #

Total comments: 4

Patch Set 5 : address maruel's comments #

Total comments: 2

Patch Set 6 : address more comments #

Total comments: 8

Patch Set 7 : address even more comments #

Total comments: 2

Patch Set 8 : fix nit; update chrome_frame/PRESUBMIT.py #

Unified diffs Side-by-side diffs Delta from patch set Stats (+453 lines, -16 lines) Patch
M ceee/PRESUBMIT.py View 1 2 3 4 5 6 7 2 chunks +9 lines, -7 lines 0 comments Download
A chrome/app/policy/PRESUBMIT.py View 1 2 3 4 5 6 1 chunk +35 lines, -0 lines 0 comments Download
M chrome/app/policy/policy_templates.json View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
A chrome/app/policy/syntax_check_policy_template_json.py View 1 2 3 1 chunk +396 lines, -0 lines 0 comments Download
M chrome_frame/PRESUBMIT.py View 1 2 3 4 5 6 7 2 chunks +12 lines, -8 lines 0 comments Download

Messages

Total messages: 16 (0 generated)
Jakob Kummerow
Here you go. As discussed, this depends on the following pending changes to the .json ...
9 years, 11 months ago (2011-01-13 10:56:30 UTC) #1
gfeher
Looks cool! Please add one-liner docstring comments to each non-trivial method. It would help me ...
9 years, 11 months ago (2011-01-14 11:57:26 UTC) #2
Jakob Kummerow
Thanks for the comments. http://codereview.chromium.org/6299001/diff/1/chrome/app/policy/syntax_check_policy_template_json.py File chrome/app/policy/syntax_check_policy_template_json.py (right): http://codereview.chromium.org/6299001/diff/1/chrome/app/policy/syntax_check_policy_template_json.py#newcode15 chrome/app/policy/syntax_check_policy_template_json.py:15: On 2011/01/14 11:57:26, gfeher wrote: ...
9 years, 11 months ago (2011-01-14 12:38:52 UTC) #3
gfeher
No more comments on code, let's see what does this do with the JSON file ...
9 years, 11 months ago (2011-01-14 13:25:07 UTC) #4
Jakob Kummerow
> No more comments on code, let's see what does this do with the JSON ...
9 years, 11 months ago (2011-01-14 14:41:55 UTC) #5
gfeher
LGTM with nits http://codereview.chromium.org/6299001/diff/11001/chrome/app/policy/syntax_check_policy_template_json.py File chrome/app/policy/syntax_check_policy_template_json.py (right): http://codereview.chromium.org/6299001/diff/11001/chrome/app/policy/syntax_check_policy_template_json.py#newcode75 chrome/app/policy/syntax_check_policy_template_json.py:75: container_name, identifier, offending) Nit: indentation. Please ...
9 years, 11 months ago (2011-01-18 10:04:07 UTC) #6
Jakob Kummerow
gfeher: fixed your nits. maruel: please take a look at chrome/app/policy/PRESUBMIT.py http://codereview.chromium.org/6299001/diff/11001/chrome/app/policy/syntax_check_policy_template_json.py File chrome/app/policy/syntax_check_policy_template_json.py (right): ...
9 years, 11 months ago (2011-01-18 10:38:36 UTC) #7
M-A Ruel
http://codereview.chromium.org/6299001/diff/16001/chrome/app/policy/PRESUBMIT.py File chrome/app/policy/PRESUBMIT.py (right): http://codereview.chromium.org/6299001/diff/16001/chrome/app/policy/PRESUBMIT.py#newcode17 chrome/app/policy/PRESUBMIT.py:17: if f.AbsoluteLocalPath() == os.path.join(input_api.PresubmitLocalPath(), input_api.os_path.join(... http://codereview.chromium.org/6299001/diff/16001/chrome/app/policy/PRESUBMIT.py#newcode19 chrome/app/policy/PRESUBMIT.py:19: sys.path.append(input_api.PresubmitLocalPath()) Don't ...
9 years, 11 months ago (2011-01-18 13:52:03 UTC) #8
Jakob Kummerow
maruel: thanks for your comments. I changed both things according to your proposals. Is there ...
9 years, 11 months ago (2011-01-18 15:02:35 UTC) #9
M-A Ruel
> Btw, I took the offending code from ceee/PRESUBMIT.py. Would you like me to > ...
9 years, 11 months ago (2011-01-18 15:10:33 UTC) #10
Jakob Kummerow
Here you go. On 2011/01/18 15:10:33, Marc-Antoine Ruel wrote: > > Btw, I took the ...
9 years, 11 months ago (2011-01-18 15:51:28 UTC) #11
M-A Ruel
The main reason I advocate to remove the loop is that it's easy to mistakenly ...
9 years, 11 months ago (2011-01-18 16:06:23 UTC) #12
Jakob Kummerow
http://codereview.chromium.org/6299001/diff/27001/ceee/PRESUBMIT.py File ceee/PRESUBMIT.py (right): http://codereview.chromium.org/6299001/diff/27001/ceee/PRESUBMIT.py#newcode14 ceee/PRESUBMIT.py:14: sys.path = ([input_api.os_path.join(input_api.PresubmitLocalPath(), On 2011/01/18 16:06:23, Marc-Antoine Ruel wrote: ...
9 years, 11 months ago (2011-01-18 16:33:54 UTC) #13
M-A Ruel
lgtm http://codereview.chromium.org/6299001/diff/32001/ceee/PRESUBMIT.py File ceee/PRESUBMIT.py (right): http://codereview.chromium.org/6299001/diff/32001/ceee/PRESUBMIT.py#newcode17 ceee/PRESUBMIT.py:17: return ceee_presubmit.CheckChange(input_api, nit: this line fits 80 cols ...
9 years, 11 months ago (2011-01-18 16:38:07 UTC) #14
Jói
Thanks Marc-Antoine. Sorry about the presubmit syspath thing guys. It was done this way to ...
9 years, 11 months ago (2011-01-19 00:24:09 UTC) #15
Jakob Kummerow
9 years, 11 months ago (2011-01-19 10:06:33 UTC) #16
Thanks for the reviews. I'll land this now.

On 2011/01/19 00:24:09, Jói wrote:
> Thanks Marc-Antoine. Sorry about the presubmit syspath thing guys. It was done
> this way to be able to reuse the same presubmit logic in multiple locations,
see
> e.g. chrome_frame/PRESUBMIT.py

Fixed that one, too.

http://codereview.chromium.org/6299001/diff/32001/ceee/PRESUBMIT.py
File ceee/PRESUBMIT.py (right):

http://codereview.chromium.org/6299001/diff/32001/ceee/PRESUBMIT.py#newcode17
ceee/PRESUBMIT.py:17: return ceee_presubmit.CheckChange(input_api,
On 2011/01/18 16:38:14, Marc-Antoine Ruel wrote:
> nit: this line fits 80 cols so no need to split it on 3.

Done.

Powered by Google App Engine
This is Rietveld 408576698