OLD | NEW |
---|---|
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 gcl. | 8 for more details about the presubmit API built into gcl. |
9 """ | 9 """ |
10 | 10 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
118 'base/gtest_prod_util.h and use FRIEND_TEST_ALL_PREFIXES() instead.', | 118 'base/gtest_prod_util.h and use FRIEND_TEST_ALL_PREFIXES() instead.', |
119 ), | 119 ), |
120 False, | 120 False, |
121 ), | 121 ), |
122 ( | 122 ( |
123 'ScopedAllowIO', | 123 'ScopedAllowIO', |
124 ( | 124 ( |
125 'New code should not use ScopedAllowIO. Post a task to the blocking pool' | 125 'New code should not use ScopedAllowIO. Post a task to the blocking pool' |
126 'or the FILE thread instead.', | 126 'or the FILE thread instead.', |
127 ), | 127 ), |
128 False, | 128 True, |
Avi (use Gerrit)
2012/06/26 18:42:58
Wow. OK.
jam
2012/06/26 19:31:33
why are you surprised? We don't want any more of t
| |
129 ), | 129 ), |
130 ( | 130 ( |
131 'FilePathWatcher::Delegate', | 131 'FilePathWatcher::Delegate', |
132 ( | 132 ( |
133 'New code should not use FilePathWatcher::Delegate. Use the callback' | 133 'New code should not use FilePathWatcher::Delegate. Use the callback' |
134 'interface instead.', | 134 'interface instead.', |
135 ), | 135 ), |
136 False, | 136 False, |
137 ), | 137 ), |
138 ( | |
139 'browser::FindLastActiveWithProfile', | |
140 ( | |
141 'This function is deprecated and we\'re working on removing it. Pass ' | |
142 'more context to get a Browser*, like a WebContents, window, or session ' | |
143 'id. Talk to ben@ or jam@ for more information.', | |
144 ), | |
145 True, | |
146 ), | |
147 ( | |
148 'browser::FindBrowserWithProfile', | |
149 ( | |
150 'This function is deprecated and we\'re working on removing it. Pass ' | |
151 'more context to get a Browser*, like a WebContents, window, or session ' | |
152 'id. Talk to ben@ or jam@ for more information.', | |
153 ), | |
154 True, | |
155 ), | |
156 ( | |
157 'browser::FindAnyBrowser', | |
158 ( | |
159 'This function is deprecated and we\'re working on removing it. Pass ' | |
160 'more context to get a Browser*, like a WebContents, window, or session ' | |
161 'id. Talk to ben@ or jam@ for more information.', | |
162 ), | |
163 True, | |
164 ), | |
165 ( | |
166 'browser::FindOrCreateTabbedBrowser', | |
167 ( | |
168 'This function is deprecated and we\'re working on removing it. Pass ' | |
169 'more context to get a Browser*, like a WebContents, window, or session ' | |
170 'id. Talk to ben@ or jam@ for more information.', | |
171 ), | |
172 True, | |
173 ), | |
174 ( | |
175 'browser::FindTabbedBrowser', | |
176 ( | |
177 'This function is deprecated and we\'re working on removing it. Pass ' | |
178 'more context to get a Browser*, like a WebContents, window, or session ' | |
179 'id. Talk to ben@ or jam@ for more information.', | |
Avi (use Gerrit)
2012/06/26 18:42:58
I think I screwed up in porting to _BANNED_CPP_FUN
jam
2012/06/26 19:31:33
Done.
| |
180 ), | |
181 True, | |
182 ), | |
138 ) | 183 ) |
139 | 184 |
140 | 185 |
141 | 186 |
142 def _CheckNoProductionCodeUsingTestOnlyFunctions(input_api, output_api): | 187 def _CheckNoProductionCodeUsingTestOnlyFunctions(input_api, output_api): |
143 """Attempts to prevent use of functions intended only for testing in | 188 """Attempts to prevent use of functions intended only for testing in |
144 non-testing code. For now this is just a best-effort implementation | 189 non-testing code. For now this is just a best-effort implementation |
145 that ignores header files and may have some false positives. A | 190 that ignores header files and may have some false positives. A |
146 better implementation would probably need a proper C++ parser. | 191 better implementation would probably need a proper C++ parser. |
147 """ | 192 """ |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
456 for non_android_re in (aura_re, win_re): | 501 for non_android_re in (aura_re, win_re): |
457 if all(re.search(non_android_re, f) for f in affected_files): | 502 if all(re.search(non_android_re, f) for f in affected_files): |
458 possibly_android = False | 503 possibly_android = False |
459 break | 504 break |
460 if possibly_android: | 505 if possibly_android: |
461 for f in change.AffectedFiles(): | 506 for f in change.AffectedFiles(): |
462 if any(re.search(r, f.LocalPath()) for r in android_re_list): | 507 if any(re.search(r, f.LocalPath()) for r in android_re_list): |
463 preferred.append('android') | 508 preferred.append('android') |
464 break | 509 break |
465 return preferred | 510 return preferred |
OLD | NEW |