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

Unified Diff: cc/PRESUBMIT.py

Issue 947983003: cc: Use the Lint function from depot_tools' presubmit_canned_checks API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cpp_lint_state Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/PRESUBMIT.py
diff --git a/cc/PRESUBMIT.py b/cc/PRESUBMIT.py
index dc826b1218cc0b5f53dd66d8469cb9b918e1dd50..fa15632fd457edaa1c6e0ab77cc5568f6f585a64 100644
--- a/cc/PRESUBMIT.py
+++ b/cc/PRESUBMIT.py
@@ -14,21 +14,11 @@ import string
CC_SOURCE_FILES=(r'^cc[\\/].*\.(cc|h)$',)
def CheckChangeLintsClean(input_api, output_api):
- input_api.cpplint._cpplint_state.ResetErrorCounts() # reset global state
source_filter = lambda x: input_api.FilterSourceFile(
x, white_list=CC_SOURCE_FILES, black_list=None)
- files = [f.AbsoluteLocalPath() for f in
- input_api.AffectedSourceFiles(source_filter)]
- level = 1 # strict, but just warn
- for file_name in files:
- input_api.cpplint.ProcessFile(file_name, level)
-
- if not input_api.cpplint._cpplint_state.error_count:
- return []
-
- return [output_api.PresubmitPromptWarning(
- 'Changelist failed cpplint.py check.')]
+ return input_api.canned_checks.CheckChangeLintsClean(
+ input_api, output_api, source_filter, lint_filters=[], verbose_level=1)
def CheckAsserts(input_api, output_api, white_list=CC_SOURCE_FILES, black_list=None):
black_list = tuple(black_list or input_api.DEFAULT_BLACK_LIST)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698