Updating trunk VERSION from 804.0 to 805.0
[chromium-blink-merge.git] / chrome / PRESUBMIT.py
blob86be7e929a1cd84d88f385f150233b6440d390da
1 # Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 """Makes sure that the chrome/ code is cpplint clean."""
7 INCLUDE_CPP_FILES_ONLY = (
8 r'.*\.cc$', r'.*\.h$'
11 EXCLUDE = (
12 # Objective C confuses everything.
13 r'.*cocoa.*',
14 r'.*_mac\.(cc|h)$',
15 r'.*_mac_.*',
16 # All the messages files do weird multiple include trickery
17 r'.*_messages_internal\.h$',
18 r'render_messages.h$',
19 # Autogenerated window resources files are off limits
20 r'.*resource.h$',
21 # GTK macros in C-ish header code cause false positives
22 r'gtk_.*\.h$',
23 # Header trickery
24 r'.*-inl\.h$',
25 # Templates
26 r'sigslotrepeater\.h$',
27 # GCC attribute trickery
28 r'sel_main\.cc$',
29 # Mozilla code
30 r'mork_reader\.h$',
31 r'mork_reader\.cc$',
32 r'nss_decryptor_linux\.cc$',
33 # Has safe printf usage that cpplint complains about
34 r'safe_browsing_util\.cc$',
35 # Too much math on one line?
36 r'bloom_filter\.cc$',
37 # Bogus ifdef tricks
38 r'renderer_webkitclient_impl\.cc$',
39 # Lines > 100 chars
40 r'gcapi\.cc$',
43 def CheckChangeOnUpload(input_api, output_api):
44 results = []
45 black_list = input_api.DEFAULT_BLACK_LIST + EXCLUDE
46 sources = lambda x: input_api.FilterSourceFile(
47 x, white_list=INCLUDE_CPP_FILES_ONLY, black_list=black_list)
48 results.extend(input_api.canned_checks.CheckChangeLintsClean(
49 input_api, output_api, sources))
50 return results