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

Issue 395022: - Add a presubmit check that lints C++ files (will submit CLs that... (Closed)

Created:
11 years, 1 month ago by Elliot Glaysher
Modified:
9 years, 7 months ago
Reviewers:
M-A Ruel
CC:
chromium-reviews_googlegroups.com, M-A Ruel
Visibility:
Public.

Description

- Add a presubmit check that lints C++ files (will submit CLs that add this to PRESUBMIT.py in the chromium tree later). - Update cpplint.py to the latest version from the style guide. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=32180

Patch Set 1 #

Total comments: 5

Patch Set 2 : '' #

Patch Set 3 : '' #

Total comments: 1

Patch Set 4 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+201 lines, -25 lines) Patch
M cpplint.py View 1 2 3 28 chunks +153 lines, -23 lines 0 comments Download
M presubmit_canned_checks.py View 1 2 3 2 chunks +45 lines, -1 line 0 comments Download
M tests/presubmit_unittest.py View 3 1 chunk +3 lines, -1 line 0 comments Download

Messages

Total messages: 4 (0 generated)
Elliot Glaysher
11 years, 1 month ago (2009-11-16 21:07:02 UTC) #1
M-A Ruel
http://codereview.chromium.org/395022/diff/1/2 File presubmit_canned_checks.py (right): http://codereview.chromium.org/395022/diff/1/2#newcode8 Line 8: import re Please use input_api.re instead. Note there ...
11 years, 1 month ago (2009-11-16 21:27:11 UTC) #2
Elliot Glaysher
http://codereview.chromium.org/395022/diff/1/2 File presubmit_canned_checks.py (right): http://codereview.chromium.org/395022/diff/1/2#newcode80 Line 80: _RE_IS_TEST = re.compile(r'.*tests?.(cc|h)$') On 2009/11/16 21:27:11, Marc-Antoine Ruel ...
11 years, 1 month ago (2009-11-16 22:08:18 UTC) #3
M-A Ruel
11 years, 1 month ago (2009-11-17 01:59:42 UTC) #4
lgtm as-is or you can implement the nit if you want, I think the code would be
better with that.

Sorry for the delay.

http://codereview.chromium.org/395022/diff/5001/4004
File presubmit_canned_checks.py (right):

http://codereview.chromium.org/395022/diff/5001/4004#newcode87
Line 87: for affected_file in input_api.AffectedSourceFiles(source_file_filter):
nit: Do you mind just using one array and do the check only around line 114?
e.g.
files = [f.AbsoluteLocalPath() for f in
input_api.AffectedSourceFiles(source_file_filter)]

for filename in files:
  if RE_IS_TEST.match(filename):
    level = 5
  else:
    level = 4
  cpplint.ProcessFile(filename, level)

The reason is that it doesn't reorder arbitrarily the files.

Powered by Google App Engine
This is Rietveld 408576698