Chromium Code Reviews

Issue 1309283003: Fix presubmit script for .cc files which include system files first. (Closed)

Created:
5 years, 3 months ago by David Yen
Modified:
5 years, 2 months ago
Reviewers:
Paweł Hajdan Jr.
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix presubmit script for .cc files which include system files first. Some files which need specialized order of includes are excluded in most of the checks, however when handling the special case first include file the excluded checks were not being skipped. R=phajdan.jr@chromium.org BUG=None TEST=Tested "git cl presubmit --force" with gpu_channel.cc changes.

Patch Set 1 #

Patch Set 2 : removed debug prints #

Patch Set 3 : Added unit test #

Total comments: 2

Patch Set 4 : Made test use windows.h which is the more realistic case #

Unified diffs Side-by-side diffs Stats (+14 lines, -1 line)
M PRESUBMIT.py View 2 chunks +2 lines, -1 line 0 comments
M PRESUBMIT_test.py View 1 chunk +12 lines, -0 lines 0 comments

Messages

Total messages: 10 (1 generated)
David Yen
5 years, 3 months ago (2015-09-01 19:01:20 UTC) #1
M-A Ruel
I'm not a src/PRESUBMIT.py owner.
5 years, 3 months ago (2015-09-01 19:02:59 UTC) #2
David Yen
This bug is causing gpu_channel.cc to not pass the presubmit test, here is what the ...
5 years, 3 months ago (2015-09-01 19:04:57 UTC) #4
Paweł Hajdan Jr.
Could you explain more why is this needed? Why does the .cc file needs to ...
5 years, 3 months ago (2015-09-02 10:43:46 UTC) #5
David Yen
On 2015/09/02 10:43:46, Paweł Hajdan Jr. wrote: > Could you explain more why is this ...
5 years, 3 months ago (2015-09-02 15:58:48 UTC) #6
David Yen
On 2015/09/02 15:58:48, David Yen wrote: > On 2015/09/02 10:43:46, Paweł Hajdan Jr. wrote: > ...
5 years, 3 months ago (2015-09-02 17:03:22 UTC) #7
Paweł Hajdan Jr.
https://codereview.chromium.org/1309283003/diff/40001/PRESUBMIT_test.py File PRESUBMIT_test.py (right): https://codereview.chromium.org/1309283003/diff/40001/PRESUBMIT_test.py#newcode139 PRESUBMIT_test.py:139: contents = ['#include "ipc/some_macros.h"', This doesn't look like a ...
5 years, 3 months ago (2015-09-03 13:23:52 UTC) #8
David Yen
On 2015/09/03 13:23:52, Paweł Hajdan Jr. wrote: > https://codereview.chromium.org/1309283003/diff/40001/PRESUBMIT_test.py > File PRESUBMIT_test.py (right): > > ...
5 years, 3 months ago (2015-09-03 16:38:52 UTC) #9
David Yen
5 years, 3 months ago (2015-09-03 16:39:27 UTC) #10
https://codereview.chromium.org/1309283003/diff/40001/PRESUBMIT_test.py
File PRESUBMIT_test.py (right):

https://codereview.chromium.org/1309283003/diff/40001/PRESUBMIT_test.py#newco...
PRESUBMIT_test.py:139: contents = ['#include "ipc/some_macros.h"',
On 2015/09/03 13:23:52, Paweł Hajdan Jr. wrote:
> This doesn't look like a realistic scenario we'd like to support.
> 
> That makes it less suitable for a test.
> 
> Do you possibly have a better scenario? Looks like with maybe fixing
> gpu_channel.cc no changes would be necessary here. Are any other files in the
> tree affected?

Done. Changed the example to windows.h to be more realistic.

Powered by Google App Engine