From 0ae7122b91b755b390aedb3c39648a63f0ed8fed Mon Sep 17 00:00:00 2001 From: "danakj@chromium.org" Date: Mon, 11 Jan 2016 19:37:11 +0000 Subject: [PATCH] Remove build/c++11 from the set of linter rules ever used. The checks are not reliable for Rvalue references, and only are allowing default/deleted constructors. They are based on the google3 internal rules which do not exactly match our own c++11 rules, and may diverge more over time. Email thread that led to this change here: https://groups.google.com/a/chromium.org/forum/#!topic/cxx/9TZvt8vyeEM R=agable@chromium.org Review URL: https://codereview.chromium.org/1573663003 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@298202 0039d316-1c4b-4281-b951-d872f2087c98 --- presubmit_canned_checks.py | 12 ++++++++++++ tests/presubmit_unittest.py | 1 + 2 files changed, 13 insertions(+) diff --git a/presubmit_canned_checks.py b/presubmit_canned_checks.py index b18e18f4e..96bd094c2 100644 --- a/presubmit_canned_checks.py +++ b/presubmit_canned_checks.py @@ -26,6 +26,17 @@ DEFAULT_LINT_FILTERS = [ '-whitespace/braces', ] +# These filters will always be removed, even if the caller specifies a filter +# set, as they are problematic or broken in some way. +# +# Justifications for each filter: +# - build/c++11 : Rvalue ref checks are unreliable (false positives), +# include file and feature blacklists are +# google3-specific. +BLACKLIST_LINT_FILTERS = [ + '-build/c++11', +] + ### Description checks def CheckChangeHasTestField(input_api, output_api): @@ -120,6 +131,7 @@ def CheckChangeLintsClean(input_api, output_api, source_file_filter=None, cpplint._cpplint_state.ResetErrorCounts() lint_filters = lint_filters or DEFAULT_LINT_FILTERS + lint_filters.extend(BLACKLIST_LINT_FILTERS) cpplint._SetFilters(','.join(lint_filters)) # We currently are more strict with normal code than unit tests; 4 and 5 are diff --git a/tests/presubmit_unittest.py b/tests/presubmit_unittest.py index 8f52a9ffd..5457170b8 100755 --- a/tests/presubmit_unittest.py +++ b/tests/presubmit_unittest.py @@ -1867,6 +1867,7 @@ class CannedChecksUnittest(PresubmitTestsBase): self.mox.ReplayAll() members = [ 'DEFAULT_LINT_FILTERS', + 'BLACKLIST_LINT_FILTERS', 'CheckBuildbotPendingBuilds', 'CheckChangeHasBugField', 'CheckChangeHasDescription', 'CheckChangeHasNoStrayWhitespace',