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

Issue 2384943002: Trim more unneeded stuff from Blink's C++ style checker script. (Closed)

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

Description

Trim more unneeded stuff from Blink's C++ style checker script. This formatting is enforced by the clang-format check, so there's no need to try to enforce it with regex that try to parse C++. BUG=none Committed: https://crrev.com/ad6db10fac0e0a689b91f72a4f34250098584ccc Cr-Commit-Position: refs/heads/master@{#422328}

Patch Set 1 #

Patch Set 2 : more stuff #

Patch Set 3 : . #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+5 lines, -800 lines) Patch
M third_party/WebKit/Tools/Scripts/webkitpy/style/checker.py View 1 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/Tools/Scripts/webkitpy/style/checkers/cpp.py View 1 7 chunks +1 line, -287 lines 3 comments Download
M third_party/WebKit/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py View 1 10 chunks +4 lines, -511 lines 0 comments Download

Messages

Total messages: 10 (3 generated)
dcheng
For whoever sees this first =) Trims check-webkit-style running time across most (all?) of Blink ...
4 years, 2 months ago (2016-10-01 07:48:37 UTC) #2
Nico
lgtm https://codereview.chromium.org/2384943002/diff/40001/third_party/WebKit/Tools/Scripts/webkitpy/style/checkers/cpp.py File third_party/WebKit/Tools/Scripts/webkitpy/style/checkers/cpp.py (right): https://codereview.chromium.org/2384943002/diff/40001/third_party/WebKit/Tools/Scripts/webkitpy/style/checkers/cpp.py#newcode1790 third_party/WebKit/Tools/Scripts/webkitpy/style/checkers/cpp.py:1790: 'Semicolon defining empty statement for this loop. Use ...
4 years, 2 months ago (2016-10-01 16:39:46 UTC) #3
dcheng
https://codereview.chromium.org/2384943002/diff/40001/third_party/WebKit/Tools/Scripts/webkitpy/style/checkers/cpp.py File third_party/WebKit/Tools/Scripts/webkitpy/style/checkers/cpp.py (right): https://codereview.chromium.org/2384943002/diff/40001/third_party/WebKit/Tools/Scripts/webkitpy/style/checkers/cpp.py#newcode1790 third_party/WebKit/Tools/Scripts/webkitpy/style/checkers/cpp.py:1790: 'Semicolon defining empty statement for this loop. Use { ...
4 years, 2 months ago (2016-10-01 19:48:04 UTC) #4
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/2384943002/40001
4 years, 2 months ago (2016-10-01 19:49:00 UTC) #6
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years, 2 months ago (2016-10-01 20:34:13 UTC) #7
commit-bot: I haz the power
Patchset 3 (id:??) landed as https://crrev.com/ad6db10fac0e0a689b91f72a4f34250098584ccc Cr-Commit-Position: refs/heads/master@{#422328}
4 years, 2 months ago (2016-10-01 20:35:52 UTC) #9
Nico
4 years, 2 months ago (2016-10-03 18:11:17 UTC) #10
Message was sent while issue was closed.
https://codereview.chromium.org/2384943002/diff/40001/third_party/WebKit/Tool...
File third_party/WebKit/Tools/Scripts/webkitpy/style/checkers/cpp.py (right):

https://codereview.chromium.org/2384943002/diff/40001/third_party/WebKit/Tool...
third_party/WebKit/Tools/Scripts/webkitpy/style/checkers/cpp.py:1790: 'Semicolon
defining empty statement for this loop. Use { } instead.')
On 2016/10/01 19:48:04, dcheng wrote:
> On 2016/10/01 16:39:46, Nico (mostly away until Oct 3) wrote:
> > I think this is caught by a compiler warning too
> 
> At least in a simple test, I wasn't able to get this warning to fire.

It only fires when it's actively buggy:

tthakis@thakis:~/src/chrome/src$ cat test.cc
void f() {
  if (1);

  if (2)
    ;

  if (3); {
  }
}
thakis@thakis:~/src/chrome/src$ third_party/llvm-build/Release+Asserts/bin/clang
-c test.cc
test.cc:2:9: warning: if statement has empty body [-Wempty-body]
  if (1);
        ^
test.cc:2:9: note: put the semicolon on a separate line to silence this warning
test.cc:7:9: warning: if statement has empty body [-Wempty-body]
  if (3); {
        ^
test.cc:7:9: note: put the semicolon on a separate line to silence this warning
2 warnings generated.



Not sure if check-webkit-style needs to be stricter than that, but you're right,
the compiler does less than what this script does.

Powered by Google App Engine
This is Rietveld 408576698