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

Issue 2598173002: Add a Presubmit to check if a file must be included or imported.

Created:
3 years, 12 months ago by Olivier
Modified:
3 years, 7 months ago
CC:
chromium-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add a Presubmit to check if a file must be included or imported. C++ headers must be included. ObjC files must be imported. Checks if a file is ObjC: - It includes @protocol, @interface, @end, @class - It imports other files. - It declares a block type Files that have a guard can be included or imported. BUG=677965

Patch Set 1 #

Total comments: 10

Patch Set 2 : feedback #

Total comments: 8

Patch Set 3 : Add block guard #

Patch Set 4 : filter file names #

Total comments: 10

Patch Set 5 : feedback #

Unified diffs Side-by-side diffs Delta from patch set Stats (+247 lines, -0 lines) Patch
M PRESUBMIT.py View 1 2 3 4 3 chunks +133 lines, -0 lines 0 comments Download
M PRESUBMIT_test.py View 1 2 3 1 chunk +114 lines, -0 lines 0 comments Download

Messages

Total messages: 23 (7 generated)
Olivier
Would something like this be useful?
3 years, 12 months ago (2016-12-23 09:14:14 UTC) #2
Eugene But (OOO till 7-30)
lgtm!!!11111oneunoодин https://codereview.chromium.org/2598173002/diff/1/PRESUBMIT.py File PRESUBMIT.py (right): https://codereview.chromium.org/2598173002/diff/1/PRESUBMIT.py#newcode780 PRESUBMIT.py:780: """Checks the include/import coherence in file f.""" Could ...
3 years, 12 months ago (2016-12-23 16:25:09 UTC) #3
Olivier
Thanks. PTAL https://codereview.chromium.org/2598173002/diff/1/PRESUBMIT.py File PRESUBMIT.py (right): https://codereview.chromium.org/2598173002/diff/1/PRESUBMIT.py#newcode780 PRESUBMIT.py:780: """Checks the include/import coherence in file f.""" ...
3 years, 12 months ago (2016-12-26 14:49:29 UTC) #5
Eugene But (OOO till 7-30)
still lgtm https://codereview.chromium.org/2598173002/diff/20001/PRESUBMIT.py File PRESUBMIT.py (right): https://codereview.chromium.org/2598173002/diff/20001/PRESUBMIT.py#newcode780 PRESUBMIT.py:780: """Checks if f is a C++ or ...
3 years, 12 months ago (2016-12-27 17:18:35 UTC) #6
Olivier
+dpranke as owner. https://codereview.chromium.org/2598173002/diff/20001/PRESUBMIT.py File PRESUBMIT.py (right): https://codereview.chromium.org/2598173002/diff/20001/PRESUBMIT.py#newcode780 PRESUBMIT.py:780: """Checks if f is a C++ ...
3 years, 11 months ago (2016-12-28 14:41:12 UTC) #9
Nico
How much does this add to presubmit runtime? Is this a big enough problem in ...
3 years, 11 months ago (2017-01-03 17:15:32 UTC) #12
Dirk Pranke
I share thakis's concerns here. Is this check fast? Can we limit it to files ...
3 years, 11 months ago (2017-01-04 02:37:44 UTC) #13
Olivier
On 2017/01/04 02:37:44, Dirk Pranke wrote: > I share thakis's concerns here. Is this check ...
3 years, 11 months ago (2017-01-04 08:16:47 UTC) #14
Dirk Pranke
On 2017/01/04 08:16:47, Olivier Robin wrote: > On 2017/01/04 02:37:44, Dirk Pranke wrote: > > ...
3 years, 11 months ago (2017-01-04 20:30:08 UTC) #15
Olivier
Hi I added a test on file name Tell me if this looks enough for ...
3 years, 11 months ago (2017-01-19 16:15:06 UTC) #16
Dirk Pranke
this basically looks okay, just a couple of minor comments and I expect the next ...
3 years, 11 months ago (2017-01-20 02:31:35 UTC) #17
Olivier
https://codereview.chromium.org/2598173002/diff/60001/PRESUBMIT.py File PRESUBMIT.py (right): https://codereview.chromium.org/2598173002/diff/60001/PRESUBMIT.py#newcode800 PRESUBMIT.py:800: An Objective-C header is a header with a line ...
3 years, 10 months ago (2017-01-27 13:27:19 UTC) #18
Dirk Pranke
Where is this limiting things to particular files or directories?
3 years, 10 months ago (2017-01-29 00:05:11 UTC) #19
Olivier
Hi This is the first test of _CheckHeaderIsObjectiveC 820 if not file_path_ios_mac_pattern.match(included_file): 821 return (False, ...
3 years, 10 months ago (2017-01-30 09:09:31 UTC) #20
Dirk Pranke
On 2017/01/30 09:09:31, Olivier Robin wrote: > Hi > > This is the first test ...
3 years, 10 months ago (2017-01-30 19:03:11 UTC) #21
Olivier
3 years, 10 months ago (2017-02-14 07:59:00 UTC) #22
On 2017/01/30 19:03:11, Dirk Pranke wrote:
> On 2017/01/30 09:09:31, Olivier Robin wrote:
> > Hi
> > 
> > This is the first test of _CheckHeaderIsObjectiveC
> > 820   if not file_path_ios_mac_pattern.match(included_file):
> > 821     return (False, False)
> > 
> > Thanks
> 
> Ah, right, thanks.
> 
> @thakis, does this look good to you?

Ping

Powered by Google App Engine
This is Rietveld 408576698