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

Unified Diff: presubmit_canned_checks.py

Issue 779033003: Add lint_filters parameter to CheckChangeLintsClean function. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 6 years 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: presubmit_canned_checks.py
diff --git a/presubmit_canned_checks.py b/presubmit_canned_checks.py
index a93a4fddd5c6f54dbd66d898009fe5b422ebff22..08746193564d97970e7bbae14204756576869fac 100644
--- a/presubmit_canned_checks.py
+++ b/presubmit_canned_checks.py
@@ -90,7 +90,8 @@ def CheckDoNotSubmitInFiles(input_api, output_api):
return []
-def CheckChangeLintsClean(input_api, output_api, source_file_filter=None):
+def CheckChangeLintsClean(input_api, output_api, source_file_filter=None,
+ lint_filters=None):
"""Checks that all '.cc' and '.h' files pass cpplint.py."""
_RE_IS_TEST = input_api.re.compile(r'.*tests?.(cc|h)$')
result = []
@@ -100,20 +101,23 @@ def CheckChangeLintsClean(input_api, output_api, source_file_filter=None):
# pylint: disable=W0212
cpplint._cpplint_state.ResetErrorCounts()
- # Justifications for each filter:
- #
- # - build/include : Too many; fix in the future.
- # - build/include_order : Not happening; #ifdefed includes.
- # - build/namespace : I'm surprised by how often we violate this rule.
- # - readability/casting : Mistakes a whole bunch of function pointer.
- # - runtime/int : Can be fixed long term; volume of errors too high
- # - runtime/virtual : Broken now, but can be fixed in the future?
- # - whitespace/braces : We have a lot of explicit scoping in chrome code.
- # - readability/inheritance : Temporary, while the OVERRIDE and FINAL fixup
- # is in progress.
- cpplint._SetFilters('-build/include,-build/include_order,-build/namespace,'
- '-readability/casting,-runtime/int,-runtime/virtual,'
- '-whitespace/braces,-readability/inheritance')
+ if lint_filters != None:
agable 2014/12/09 21:34:48 s/!=/is not/
+ cpplint._SetFilters(lint_filters)
+ else:
+ # Justifications for each filter:
+ #
+ # - build/include : Too many; fix in the future.
tfarina 2014/12/08 01:05:39 I want to enable these checks in app_list, as we c
Dirk Pranke 2014/12/09 21:17:07 It looks like ui/app_list/PRESUBMIT.py has its own
+ # - build/include_order : Not happening; #ifdefed includes.
+ # - build/namespace : I'm surprised by how often we violate this rule.
+ # - readability/casting : Mistakes a whole bunch of function pointer.
+ # - runtime/int : Can be fixed long term; volume of errors too high
+ # - runtime/virtual : Broken now, but can be fixed in the future?
+ # - whitespace/braces : We have a lot of explicit scoping in chrome code.
+ # - readability/inheritance : Temporary, while the OVERRIDE and FINAL fixup
+ # is in progress.
+ cpplint._SetFilters('-build/include,-build/include_order,-build/namespace,'
+ '-readability/casting,-runtime/int,-runtime/virtual,'
+ '-whitespace/braces,-readability/inheritance')
# We currently are more strict with normal code than unit tests; 4 and 5 are
# the verbosity level that would normally be passed to cpplint.py through
« 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