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

Issue 344563003: Add PRESUBMIT.py warning for contradictory NOTREACHED() use. (Closed)

Created:
6 years, 6 months ago by Thiemo Nagel
Modified:
6 years, 6 months ago
Reviewers:
M-A Ruel
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

Add PRESUBMIT.py warning for contradictory NOTREACHED() use. As recently discussed on chromium-dev [1] and subsequently incorporated into the Chromium Coding Style [2], NOTREACHED() followed by code is an anti-pattern. This CL lets PRESUBMIT.py detect most of these cases and print a warning to the developer. [1] https://groups.google.com/a/chromium.org/d/msg/chromium-dev/c2X0D1Z6X2o/ddkFLqQP0P0J [2] http://www.chromium.org/developers/coding-style#TOC-CHECK-DCHECK-and-NOTREACHED- BUG=none Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=279681

Patch Set 1 #

Total comments: 12

Patch Set 2 : Address maruel's comments. Minor improvements. #

Total comments: 6

Patch Set 3 : Address more comments by maruel. #

Patch Set 4 : Rebase. #

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

Messages

Total messages: 12 (0 generated)
Thiemo Nagel
Hi Peter, after our discussion in MTV last week, would you mind to take a ...
6 years, 6 months ago (2014-06-18 17:16:41 UTC) #1
Peter Kasting
Unfortunately I'm not capable of reviewing Python changes; please send to someone who has done ...
6 years, 6 months ago (2014-06-18 18:06:14 UTC) #2
Thiemo Nagel
Hi Marc-Antoine, could you please be so kind to take a look at this CL ...
6 years, 6 months ago (2014-06-18 19:23:36 UTC) #3
M-A Ruel
It's a bit on the heavy side for processing but I don't mind that much. ...
6 years, 6 months ago (2014-06-18 19:35:11 UTC) #4
Thiemo Nagel
Many thanks for your review! I've addressed your comments, could you please take another look? ...
6 years, 6 months ago (2014-06-24 12:07:38 UTC) #5
M-A Ruel
lgtm https://codereview.chromium.org/344563003/diff/40001/PRESUBMIT.py File PRESUBMIT.py (right): https://codereview.chromium.org/344563003/diff/40001/PRESUBMIT.py#newcode1067 PRESUBMIT.py:1067: input data is formatted with unix-style line ends.""" ...
6 years, 6 months ago (2014-06-24 17:45:22 UTC) #6
Thiemo Nagel
Thank you! https://codereview.chromium.org/344563003/diff/40001/PRESUBMIT.py File PRESUBMIT.py (right): https://codereview.chromium.org/344563003/diff/40001/PRESUBMIT.py#newcode1067 PRESUBMIT.py:1067: input data is formatted with unix-style line ...
6 years, 6 months ago (2014-06-25 06:45:54 UTC) #7
Thiemo Nagel
The CQ bit was checked by tnagel@chromium.org
6 years, 6 months ago (2014-06-25 06:48:52 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/tnagel@chromium.org/344563003/80001
6 years, 6 months ago (2014-06-25 06:51:35 UTC) #9
commit-bot: I haz the power
Change committed as 279681
6 years, 6 months ago (2014-06-25 11:55:25 UTC) #10
M-A Ruel
On 2014/06/25 11:55:25, I haz the power (commit-bot) wrote: > Change committed as 279681 FTR, ...
6 years, 6 months ago (2014-06-25 13:13:36 UTC) #11
Miguel Garcia
6 years, 6 months ago (2014-06-25 14:07:58 UTC) #12
Message was sent while issue was closed.
A revert of this CL has been created in
https://codereview.chromium.org/357693004/ by miguelg@chromium.org.

The reason for reverting is: It seems to be checking code that is not part of
the diff. 

I also think there are some legitimate cases for not reached in the middle of a
block but that is something that can be discussed on the bug.

Filed https://code.google.com/p/chromium/issues/detail?id=388731 to track..

Powered by Google App Engine
This is Rietveld 408576698