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

Issue 1411553003: PRESUBMIT: Bark about DISALLOW_* macros without #include "base/macros.h" (Closed)

Created:
5 years, 2 months ago by Dan Beam
Modified:
5 years ago
CC:
chromium-reviews, danakj
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

PRESUBMIT: Bark about DISALLOW_* macros without #include "base/macros.h" I'm sick of enforcing this in like every code review. R=cpu@chromium.org,maruel@chromium.org TBR=phajdan.jr@chromium.org BUG=none TEST=PRESUBMIT_test.py Committed: https://crrev.com/3aa3839c53008b3ee094e93f26f25d8306c06cc7 Cr-Commit-Position: refs/heads/master@{#354607}

Patch Set 1 #

Total comments: 2

Patch Set 2 : maruel@ review #

Unified diffs Side-by-side diffs Delta from patch set Stats (+61 lines, -0 lines) Patch
M PRESUBMIT.py View 1 2 chunks +24 lines, -0 lines 0 comments Download
M PRESUBMIT_test.py View 1 chunk +37 lines, -0 lines 0 comments Download

Messages

Total messages: 29 (9 generated)
Dan Beam
5 years, 2 months ago (2015-10-15 23:32:17 UTC) #1
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1411553003/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1411553003/1
5 years, 2 months ago (2015-10-16 07:51:17 UTC) #3
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 2 months ago (2015-10-16 08:01:32 UTC) #5
cpu_(ooo_6.6-7.5)
looks nice but turns out I don't know python. Please have anybody who does review ...
5 years, 2 months ago (2015-10-16 17:50:27 UTC) #6
Dan Beam
+maruel@ knows python!
5 years, 2 months ago (2015-10-16 19:30:23 UTC) #8
Dan Beam
-maruel@, +phajdan.jr@
5 years, 2 months ago (2015-10-16 20:48:05 UTC) #10
M-A Ruel
lgtm with nit https://codereview.chromium.org/1411553003/diff/1/PRESUBMIT.py File PRESUBMIT.py (right): https://codereview.chromium.org/1411553003/diff/1/PRESUBMIT.py#newcode1523 PRESUBMIT.py:1523: disallows = ['DISALLOW_%s' % s for ...
5 years, 2 months ago (2015-10-16 21:09:26 UTC) #12
Dan Beam
https://codereview.chromium.org/1411553003/diff/1/PRESUBMIT.py File PRESUBMIT.py (right): https://codereview.chromium.org/1411553003/diff/1/PRESUBMIT.py#newcode1523 PRESUBMIT.py:1523: disallows = ['DISALLOW_%s' % s for s in ('ASSIGN', ...
5 years, 2 months ago (2015-10-16 21:24:15 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1411553003/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1411553003/20001
5 years, 2 months ago (2015-10-16 21:25:30 UTC) #16
commit-bot: I haz the power
Committed patchset #2 (id:20001)
5 years, 2 months ago (2015-10-16 21:38:10 UTC) #17
commit-bot: I haz the power
Patchset 2 (id:??) landed as https://crrev.com/3aa3839c53008b3ee094e93f26f25d8306c06cc7 Cr-Commit-Position: refs/heads/master@{#354607}
5 years, 2 months ago (2015-10-16 21:39:11 UTC) #18
danakj
:/ I wanted to put DISALLOW_COPY_AND_ASSIGN_WITH_MOVE_FOR_BIND in base/move.h but now that fails this check. Did ...
5 years ago (2015-12-04 00:25:53 UTC) #20
Dan Beam
On 2015/12/04 00:25:53, danakj (behind on reviews) wrote: > :/ > > I wanted to ...
5 years ago (2015-12-04 00:29:24 UTC) #22
Dan Beam
On 2015/12/04 00:29:24, Dan Beam wrote: > On 2015/12/04 00:25:53, danakj (behind on reviews) wrote: ...
5 years ago (2015-12-04 00:39:18 UTC) #23
danakj
On Thu, Dec 3, 2015 at 4:39 PM, <dbeam@chromium.org> wrote: > On 2015/12/04 00:29:24, Dan ...
5 years ago (2015-12-04 00:42:41 UTC) #24
Dan Beam
On 2015/12/04 00:42:41, danakj (behind on reviews) wrote: > On Thu, Dec 3, 2015 at ...
5 years ago (2015-12-04 00:44:49 UTC) #25
Dan Beam
On 2015/12/04 00:29:24, Dan Beam wrote: > On 2015/12/04 00:25:53, danakj (behind on reviews) wrote: ...
5 years ago (2015-12-04 00:49:42 UTC) #26
danakj
On Thu, Dec 3, 2015 at 4:44 PM, <dbeam@chromium.org> wrote: > On 2015/12/04 00:42:41, danakj ...
5 years ago (2015-12-04 00:52:29 UTC) #27
Dan Beam
On 2015/12/04 00:52:29, danakj (behind on reviews) wrote: > On Thu, Dec 3, 2015 at ...
5 years ago (2015-12-04 00:59:46 UTC) #28
danakj
5 years ago (2015-12-04 01:05:54 UTC) #29
Message was sent while issue was closed.
On Thu, Dec 3, 2015 at 4:59 PM, <dbeam@chromium.org> wrote:

> On 2015/12/04 00:52:29, danakj (behind on reviews) wrote:
>
> On Thu, Dec 3, 2015 at 4:44 PM, <mailto:dbeam@chromium.org> wrote:
>>
>
> > On 2015/12/04 00:42:41, danakj (behind on reviews) wrote:
>> >
>> >> On Thu, Dec 3, 2015 at 4:39 PM, <mailto:dbeam@chromium.org> wrote:
>> >>
>> >
>> > > On 2015/12/04 00:29:24, Dan Beam wrote:
>> >> >
>> >> >> On 2015/12/04 00:25:53, danakj (behind on reviews) wrote:
>> >> >> > :/
>> >> >> >
>> >> >> > I wanted to put DISALLOW_COPY_AND_ASSIGN_WITH_MOVE_FOR_BIND in
>> >> >> base/move.h
>> >> >>
>> >> > but
>> >> >
>> >> >> > now that fails this check. Did we really need a special IWYU rule
>> >> for 3
>> >> >>
>> >> > macros
>> >> >
>> >> >> > in 1 header?
>> >> >> >
>> >> >> > Things don't compile if you DISALLOW_COPY_AND_ASSIGN(T) and the
>> macro
>> >> >> isn't
>> >> >> > defined.
>> >> >>
>> >> >
>> >> > ^ and yes, but it's almost always transitively defined
>> >>
>> >
>> >
>> > I just don't get what's so terrible about that in this case? This
>> happens
>> >> all the time for all kinds of things in chrome since we don't have good
>> >> IWYU tooling.
>> >>
>> >
>> > It just happens in like every header file I ever review, heh
>> >
>>
>
> I guess I just think that it probably happens for other things you don't
>> notice in every file too. I know it happens for me but I don't bother
>> really. Like sometimes I ask people to add headers but I can't catch them
>> all and this is probably one I care about the least, cuz it's already
>> included everywhere so least likely to cause problems where you change
>> header A and it causes file B to stop compiling.
>>
>
> I really wish for good IWYU, but was pretty surprised to see us rolling out
>> own IWYU for individual macros like this. Generally I'm a fan of presubmit
>> checks to make reviewing easier. At first sight, this doesn't hit my bar
>> for value of the check vs slowing down time to upload CLs.
>>
>
> After this, do we add more checks for LOG macros? And then start building a
>> database of "Class A is in File B"? Then we add friction for every change
>> people want to make that refactors code, etc. In this case it's adding
>> friction if we make changes to base/ causing us to get a PRESUBMIT.py file
>> owner review that is very unrelated to the change in question. That is why
>> I am not a fan of this strategy.
>>
>
> Neither am I.  What are you concrete plans to add better IWYU tools?
>

Right I don't have any plans here.

I'm sorry you hit an issue when trying to make a new macro that starts with
> DISALLOW_COPY_AND_ASSIGN (that I think would be fixed by:
> https://codereview.chromium.org/1490383004/).


Yes I appreciate that you're updating the rule to be more specific.


> This presubmit has saved me lots

of typing already and has worked OK for the other ~8400 commits that have
> landed
> since this one, as far as I know (oysteine@ hit an issue and we fixed it).
>

My problem isn't that this won't work for most CLs, it's that it is
hardcoding locations of C++ code into some python file in src/, which
causes friction for people changing that C++ code. I'd bet you'd be less
than thrilled if it was hardcoding things about C++ that you change, rather
than usually only depend on.

This code changes in-frequently, so sure patching it will work here. But I
don't like this as a concept, and don't look forward to more people adding
similar checks, citing this one as existing, until we have a second copy of
the chromium repo written in some python file so it can check all these
things and suddenly terminators appear and... anyway I don't like the
precident. :)

-- 
You received this message because you are subscribed to the Google Groups
"Chromium-reviews" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to chromium-reviews+unsubscribe@chromium.org.

Powered by Google App Engine
This is Rietveld 408576698