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

Issue 2380003003: Update PRESUBMIT check for use counters to handle C++ formatting changes (Closed)

Created:
4 years, 2 months ago by dcheng
Modified:
4 years, 2 months ago
Reviewers:
Nico, qyearsley
CC:
chromium-reviews, blink-reviews, Dirk Pranke
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Update PRESUBMIT check for use counters to handle C++ formatting changes Long-term, we probably want to consider generating this somehow, rather than using regex to try to parse stuff out of C++. BUG=649969 Committed: https://crrev.com/c4c4814a47286093f5ea69a9ae5070d14dd48572 Cr-Commit-Position: refs/heads/master@{#422017}

Patch Set 1 #

Total comments: 5

Patch Set 2 : Simplify regex and fix comment. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+24 lines, -21 lines) Patch
M third_party/WebKit/Source/core/frame/PRESUBMIT.py View 1 2 chunks +24 lines, -21 lines 0 comments Download

Messages

Total messages: 15 (5 generated)
dcheng
I think this is the last known presubmit change that we can split out of ...
4 years, 2 months ago (2016-09-29 20:35:26 UTC) #2
Nico
lgtm https://codereview.chromium.org/2380003003/diff/1/third_party/WebKit/Source/core/frame/PRESUBMIT.py File third_party/WebKit/Source/core/frame/PRESUBMIT.py (right): https://codereview.chromium.org/2380003003/diff/1/third_party/WebKit/Source/core/frame/PRESUBMIT.py#newcode25 third_party/WebKit/Source/core/frame/PRESUBMIT.py:25: r'case CSSProperty\w*?\:\s*?\n?\s+?return (\d+);', why \s+ instead of \s* ...
4 years, 2 months ago (2016-09-30 00:41:18 UTC) #4
dcheng
https://codereview.chromium.org/2380003003/diff/1/third_party/WebKit/Source/core/frame/PRESUBMIT.py File third_party/WebKit/Source/core/frame/PRESUBMIT.py (right): https://codereview.chromium.org/2380003003/diff/1/third_party/WebKit/Source/core/frame/PRESUBMIT.py#newcode25 third_party/WebKit/Source/core/frame/PRESUBMIT.py:25: r'case CSSProperty\w*?\:\s*?\n?\s+?return (\d+);', On 2016/09/30 00:41:18, Nico (mostly away ...
4 years, 2 months ago (2016-09-30 01:56:38 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2380003003/20001
4 years, 2 months ago (2016-09-30 01:56:51 UTC) #8
Nico
https://codereview.chromium.org/2380003003/diff/1/third_party/WebKit/Source/core/frame/PRESUBMIT.py File third_party/WebKit/Source/core/frame/PRESUBMIT.py (right): https://codereview.chromium.org/2380003003/diff/1/third_party/WebKit/Source/core/frame/PRESUBMIT.py#newcode25 third_party/WebKit/Source/core/frame/PRESUBMIT.py:25: r'case CSSProperty\w*?\:\s*?\n?\s+?return (\d+);', On 2016/09/30 01:56:38, dcheng wrote: > ...
4 years, 2 months ago (2016-09-30 02:24:52 UTC) #9
dcheng
On 2016/09/30 02:24:52, Nico (mostly away until Oct 3) wrote: > https://codereview.chromium.org/2380003003/diff/1/third_party/WebKit/Source/core/frame/PRESUBMIT.py > File third_party/WebKit/Source/core/frame/PRESUBMIT.py ...
4 years, 2 months ago (2016-09-30 02:30:21 UTC) #10
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 2 months ago (2016-09-30 02:48:22 UTC) #11
commit-bot: I haz the power
Patchset 2 (id:??) landed as https://crrev.com/c4c4814a47286093f5ea69a9ae5070d14dd48572 Cr-Commit-Position: refs/heads/master@{#422017}
4 years, 2 months ago (2016-09-30 02:52:24 UTC) #13
Nico
On 2016/09/30 02:30:21, dcheng wrote: > On 2016/09/30 02:24:52, Nico (mostly away until Oct 3) ...
4 years, 2 months ago (2016-09-30 13:30:15 UTC) #14
dcheng
4 years, 2 months ago (2016-09-30 15:09:12 UTC) #15
Message was sent while issue was closed.
On 2016/09/30 13:30:15, Nico (mostly away until Oct 3) wrote:
> On 2016/09/30 02:30:21, dcheng wrote:
> > On 2016/09/30 02:24:52, Nico (mostly away until Oct 3) wrote:
> > >
> >
>
https://codereview.chromium.org/2380003003/diff/1/third_party/WebKit/Source/c...
> > > File third_party/WebKit/Source/core/frame/PRESUBMIT.py (right):
> > > 
> > >
> >
>
https://codereview.chromium.org/2380003003/diff/1/third_party/WebKit/Source/c...
> > > third_party/WebKit/Source/core/frame/PRESUBMIT.py:25: r'case
> > > CSSProperty\w*?\:\s*?\n?\s+?return (\d+);',
> > > On 2016/09/30 01:56:38, dcheng wrote:
> > > > On 2016/09/30 00:41:18, Nico (mostly away until Oct 3) wrote:
> > > > > why \s+ instead of \s* ?
> > > > > 
> > > > > So `return\n43;` doesn't happen in practice?
> > > > 
> > > > I think \s will match \n, since we're matching in multiline mode. I
> > simplified
> > > > it a bit overall by replacing \s*?\n?\s+ with just \s+?
> > > 
> > > I mean isn't `\s+?` the same as `\s*` ?
> > 
> > + is 1 or more, * is 0 or more. I don't think it'll happen, but in case
> someone
> > somehow uses return123124 in an identifier, we don't want to match that.
> 
> Well yeah, but if you put ? after \s+ it means "one or more, or not" which
seems
> like the same as "zero or more"

Ah. So ? combined with +, *, or ? turns it into a non greedy version. By
default, +, *, and ? match as much as they can. In contrast, +? match as little
as possible.

That being said, using the non greedy version here doesn't really matter, and I
probably should have just used the greedy one.

Powered by Google App Engine
This is Rietveld 408576698