OLD | NEW |
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 Loading... |
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 Loading... |
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() |
OLD | NEW |