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

Side by Side Diff: PRESUBMIT.py

Issue 2765423003: Add presubmit check to warn against using NULL (Closed)
Patch Set: Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Top-level presubmit script for Chromium. 5 """Top-level presubmit script for Chromium.
6 6
7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts 7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
8 for more details about the presubmit API built into depot_tools. 8 for more details about the presubmit API built into depot_tools.
9 """ 9 """
10 10
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 True, 148 True,
149 ), 149 ),
150 ) 150 )
151 151
152 152
153 _BANNED_CPP_FUNCTIONS = ( 153 _BANNED_CPP_FUNCTIONS = (
154 # Make sure that gtest's FRIEND_TEST() macro is not used; the 154 # Make sure that gtest's FRIEND_TEST() macro is not used; the
155 # FRIEND_TEST_ALL_PREFIXES() macro from base/gtest_prod_util.h should be 155 # FRIEND_TEST_ALL_PREFIXES() macro from base/gtest_prod_util.h should be
156 # used instead since that allows for FLAKY_ and DISABLED_ prefixes. 156 # used instead since that allows for FLAKY_ and DISABLED_ prefixes.
157 ( 157 (
158 r'\bNULL\b',
159 (
160 'New code should not use NULL. Use nullptr instead.',
161 ),
162 True,
163 (),
164 ),
165 (
158 'FRIEND_TEST(', 166 'FRIEND_TEST(',
159 ( 167 (
160 'Chromium code should not use gtest\'s FRIEND_TEST() macro. Include', 168 'Chromium code should not use gtest\'s FRIEND_TEST() macro. Include',
161 'base/gtest_prod_util.h and use FRIEND_TEST_ALL_PREFIXES() instead.', 169 'base/gtest_prod_util.h and use FRIEND_TEST_ALL_PREFIXES() instead.',
162 ), 170 ),
163 False, 171 False,
164 (), 172 (),
165 ), 173 ),
166 ( 174 (
167 r'XSelectInput|CWEventMask|XCB_CW_EVENT_MASK', 175 r'XSelectInput|CWEventMask|XCB_CW_EVENT_MASK',
(...skipping 2204 matching lines...) Expand 10 before | Expand all | Expand 10 after
2372 output_api, 2380 output_api,
2373 json_url='http://chromium-status.appspot.com/current?format=json')) 2381 json_url='http://chromium-status.appspot.com/current?format=json'))
2374 2382
2375 results.extend( 2383 results.extend(
2376 input_api.canned_checks.CheckPatchFormatted(input_api, output_api)) 2384 input_api.canned_checks.CheckPatchFormatted(input_api, output_api))
2377 results.extend(input_api.canned_checks.CheckChangeHasBugField( 2385 results.extend(input_api.canned_checks.CheckChangeHasBugField(
2378 input_api, output_api)) 2386 input_api, output_api))
2379 results.extend(input_api.canned_checks.CheckChangeHasDescription( 2387 results.extend(input_api.canned_checks.CheckChangeHasDescription(
2380 input_api, output_api)) 2388 input_api, output_api))
2381 return results 2389 return results
OLDNEW
« 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