 Chromium Code Reviews
 Chromium Code Reviews Issue 924863002:
  Remove the Singleton<T> presubmit check from presubmit_canned_checks.py  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
    
  
    Issue 924863002:
  Remove the Singleton<T> presubmit check from presubmit_canned_checks.py  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master| Index: presubmit_canned_checks.py | 
| diff --git a/presubmit_canned_checks.py b/presubmit_canned_checks.py | 
| index bd628fb3665c4cc289f22c02c91a5510348eb1c0..2496321fd23fbcbcfbc37dd1f3dd04c7aafeaafc 100644 | 
| --- a/presubmit_canned_checks.py | 
| +++ b/presubmit_canned_checks.py | 
| @@ -971,25 +971,7 @@ def _CheckConstNSObject(input_api, output_api, source_file_filter): | 
| def CheckSingletonInHeaders(input_api, output_api, source_file_filter=None): | 
| - """Checks to make sure no header files have |Singleton<|.""" | 
| - pattern = input_api.re.compile(r'(?<!class\s)Singleton\s*<') | 
| - files = [] | 
| - for f in input_api.AffectedSourceFiles(source_file_filter): | 
| - if (f.LocalPath().endswith('.h') or f.LocalPath().endswith('.hxx') or | 
| - f.LocalPath().endswith('.hpp') or f.LocalPath().endswith('.inl')): | 
| - contents = input_api.ReadFile(f) | 
| - for line in contents.splitlines(False): | 
| - if (not input_api.re.match(r'//', line) and # Strip C++ comment. | 
| - pattern.search(line)): | 
| - files.append(f) | 
| - break | 
| - | 
| - if files: | 
| - return [ output_api.PresubmitError( | 
| - 'Found Singleton<T> in the following header files.\n' + | 
| - 'Please move them to an appropriate source file so that the ' + | 
| - 'template gets instantiated in a single compilation unit.', | 
| - files) ] | 
| + """Deprecated, must be removed.""" | 
| return [] | 
| 
M-A Ruel
2015/02/19 16:12:03
return [
  output_api.PresubmitNotifyResult(
    '
 
Alexander Potapenko
2015/02/19 16:27:20
Done.
 | 
| @@ -1078,9 +1060,6 @@ def PanProjectChecks(input_api, output_api, | 
| snapshot("checking nsobjects") | 
| results.extend(_CheckConstNSObject( | 
| input_api, output_api, source_file_filter=sources)) | 
| - snapshot("checking singletons") | 
| - results.extend(CheckSingletonInHeaders( | 
| - input_api, output_api, source_file_filter=sources)) | 
| # The following checks are only done on commit, since the commit bot will | 
| # auto-fix most of these. |