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

Side by Side Diff: PRESUBMIT.py

Issue 1490383004: Make DISALLOW_* presubmit stricter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | PRESUBMIT_test.py » ('j') | 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 1522 matching lines...) Expand 10 before | Expand all | Expand 10 after
1533 'Found base::Singleton<T> in the following header files.\n' + 1533 'Found base::Singleton<T> in the following header files.\n' +
1534 'Please move them to an appropriate source file so that the ' + 1534 'Please move them to an appropriate source file so that the ' +
1535 'template gets instantiated in a single compilation unit.', 1535 'template gets instantiated in a single compilation unit.',
1536 files) ] 1536 files) ]
1537 return [] 1537 return []
1538 1538
1539 1539
1540 def _CheckBaseMacrosInHeaders(input_api, output_api): 1540 def _CheckBaseMacrosInHeaders(input_api, output_api):
1541 """Check for base/macros.h if DISALLOW_* macro is used.""" 1541 """Check for base/macros.h if DISALLOW_* macro is used."""
1542 1542
1543 disallows = ('DISALLOW_ASSIGN', 'DISALLOW_COPY', 'DISALLOW_EVIL') 1543 disallows = (
1544 'DISALLOW_ASSIGN(',
1545 'DISALLOW_COPY(',
1546 'DISALLOW_COPY_AND_ASSIGN(',
1547 'DISALLOW_EVIL_CONSTRUCTORS(',
Nico 2015/12/04 21:42:56 fwiw i removed DISALLOW_EVIL_CTORS from macros.h e
Dan Beam 2015/12/04 22:53:02 look down, look back THE PRESUBMIT IS NOW GONE h
1548 'DISALLOW_IMPLICIT_CONSTRUCTORS(',
1549 )
1544 macros = '#include "base/macros.h"' 1550 macros = '#include "base/macros.h"'
1545 basictypes = '#include "base/basictypes.h"' 1551 basictypes = '#include "base/basictypes.h"'
1546 1552
1547 files = [] 1553 files = []
1548 for f in input_api.AffectedSourceFiles(None): 1554 for f in input_api.AffectedSourceFiles(None):
1549 if not f.LocalPath().endswith('.h'): 1555 if not f.LocalPath().endswith('.h'):
1550 continue 1556 continue
1551 for line_num, line in f.ChangedContents(): 1557 for line_num, line in f.ChangedContents():
1552 if line.lstrip().startswith('//'): # Strip C++ comment. 1558 if line.lstrip().startswith('//'): # Strip C++ comment.
1553 continue 1559 continue
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
1994 for master in masters: 2000 for master in masters:
1995 try_config.setdefault(master, {}) 2001 try_config.setdefault(master, {})
1996 for builder in masters[master]: 2002 for builder in masters[master]:
1997 # Do not trigger presubmit builders, since they're likely to fail 2003 # Do not trigger presubmit builders, since they're likely to fail
1998 # (e.g. OWNERS checks before finished code review), and we're 2004 # (e.g. OWNERS checks before finished code review), and we're
1999 # running local presubmit anyway. 2005 # running local presubmit anyway.
2000 if 'presubmit' not in builder: 2006 if 'presubmit' not in builder:
2001 try_config[master][builder] = ['defaulttests'] 2007 try_config[master][builder] = ['defaulttests']
2002 2008
2003 return try_config 2009 return try_config
OLDNEW
« no previous file with comments | « no previous file | PRESUBMIT_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698