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

Side by Side Diff: cpplint.py

Issue 2146553003: Support C++11 types in build/include_what_you_use (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Rebased Created 4 years, 5 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 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright (c) 2009 Google Inc. All rights reserved. 3 # Copyright (c) 2009 Google Inc. All rights reserved.
4 # 4 #
5 # Redistribution and use in source and binary forms, with or without 5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions are 6 # modification, are permitted provided that the following conditions are
7 # met: 7 # met:
8 # 8 #
9 # * Redistributions of source code must retain the above copyright 9 # * Redistributions of source code must retain the above copyright
10 # notice, this list of conditions and the following disclaimer. 10 # notice, this list of conditions and the following disclaimer.
(...skipping 5226 matching lines...) Expand 10 before | Expand all | Expand 10 after
5237 'ptr_fun', 5237 'ptr_fun',
5238 'mem_fun_t', 'mem_fun', 'mem_fun1_t', 'mem_fun1_ref_t', 5238 'mem_fun_t', 'mem_fun', 'mem_fun1_t', 'mem_fun1_ref_t',
5239 'mem_fun_ref_t', 5239 'mem_fun_ref_t',
5240 'const_mem_fun_t', 'const_mem_fun1_t', 5240 'const_mem_fun_t', 'const_mem_fun1_t',
5241 'const_mem_fun_ref_t', 'const_mem_fun1_ref_t', 5241 'const_mem_fun_ref_t', 'const_mem_fun1_ref_t',
5242 'mem_fun_ref', 5242 'mem_fun_ref',
5243 )), 5243 )),
5244 ('<limits>', ('numeric_limits',)), 5244 ('<limits>', ('numeric_limits',)),
5245 ('<list>', ('list',)), 5245 ('<list>', ('list',)),
5246 ('<map>', ('map', 'multimap',)), 5246 ('<map>', ('map', 'multimap',)),
5247 ('<memory>', ('allocator',)), 5247 ('<memory>', ('allocator', 'make_shared', 'make_unique', 'shared_ptr',
5248 'unique_ptr', 'weak_ptr')),
5248 ('<queue>', ('queue', 'priority_queue',)), 5249 ('<queue>', ('queue', 'priority_queue',)),
5249 ('<set>', ('set', 'multiset',)), 5250 ('<set>', ('set', 'multiset',)),
5250 ('<stack>', ('stack',)), 5251 ('<stack>', ('stack',)),
5251 ('<string>', ('char_traits', 'basic_string',)), 5252 ('<string>', ('char_traits', 'basic_string',)),
5252 ('<tuple>', ('tuple',)), 5253 ('<tuple>', ('tuple',)),
5254 ('<unordered_map>', ('unordered_map', 'unordered_multimap')),
5255 ('<unordered_set>', ('unordered_set', 'unordered_multiset')),
5253 ('<utility>', ('pair',)), 5256 ('<utility>', ('pair',)),
5254 ('<vector>', ('vector',)), 5257 ('<vector>', ('vector',)),
5255 5258
5256 # gcc extensions. 5259 # gcc extensions.
5257 # Note: std::hash is their hash, ::hash is our hash 5260 # Note: std::hash is their hash, ::hash is our hash
5258 ('<hash_map>', ('hash_map', 'hash_multimap',)), 5261 ('<hash_map>', ('hash_map', 'hash_multimap',)),
5259 ('<hash_set>', ('hash_set', 'hash_multiset',)), 5262 ('<hash_set>', ('hash_set', 'hash_multiset',)),
5260 ('<slist>', ('slist',)), 5263 ('<slist>', ('slist',)),
5261 ) 5264 )
5262 5265
5263 _HEADERS_MAYBE_TEMPLATES = ( 5266 _HEADERS_MAYBE_TEMPLATES = (
5264 ('<algorithm>', ('copy', 'max', 'min', 'min_element', 'sort', 5267 ('<algorithm>', ('copy', 'max', 'min', 'min_element', 'sort',
5265 'transform', 5268 'transform',
5266 )), 5269 )),
5267 ('<utility>', ('swap',)), 5270 ('<utility>', ('forward', 'make_pair', 'move', 'swap')),
5268 ) 5271 )
5269 5272
5270 _RE_PATTERN_STRING = re.compile(r'\bstring\b') 5273 _RE_PATTERN_STRING = re.compile(r'\bstring\b')
5271 5274
5272 _re_pattern_headers_maybe_templates = [] 5275 _re_pattern_headers_maybe_templates = []
5273 for _header, _templates in _HEADERS_MAYBE_TEMPLATES: 5276 for _header, _templates in _HEADERS_MAYBE_TEMPLATES:
5274 for _template in _templates: 5277 for _template in _templates:
5275 # Match max<type>(..., ...), max(..., ...), but not foo->max, foo.max or 5278 # Match max<type>(..., ...), max(..., ...), but not foo->max, foo.max or
5276 # type::max(). 5279 # type::max().
5277 _re_pattern_headers_maybe_templates.append( 5280 _re_pattern_headers_maybe_templates.append(
(...skipping 810 matching lines...) Expand 10 before | Expand all | Expand 10 after
6088 _cpplint_state.ResetErrorCounts() 6091 _cpplint_state.ResetErrorCounts()
6089 for filename in filenames: 6092 for filename in filenames:
6090 ProcessFile(filename, _cpplint_state.verbose_level) 6093 ProcessFile(filename, _cpplint_state.verbose_level)
6091 _cpplint_state.PrintErrorCounts() 6094 _cpplint_state.PrintErrorCounts()
6092 6095
6093 sys.exit(_cpplint_state.error_count > 0) 6096 sys.exit(_cpplint_state.error_count > 0)
6094 6097
6095 6098
6096 if __name__ == '__main__': 6099 if __name__ == '__main__':
6097 main() 6100 main()
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