OLD | NEW |
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 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 Blink. | 5 """Top-level presubmit script for Blink. |
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 |
11 import os | 11 import os |
12 import re | 12 import re |
13 import sys | 13 import sys |
14 | 14 |
15 | 15 |
16 _EXCLUDED_PATHS = () | 16 _EXCLUDED_PATHS = () |
17 | 17 |
18 | 18 |
19 def _CheckForNonBlinkVariantMojomIncludes(input_api, output_api): | 19 def _CheckForNonBlinkVariantMojomIncludes(input_api, output_api): |
20 pattern = input_api.re.compile(r'#include\s+.+\.mojom(.*)\.h[>"]') | 20 pattern = input_api.re.compile(r'#include\s+.+\.mojom(.*)\.h[>"]') |
21 errors = [] | 21 errors = [] |
22 for f in input_api.AffectedFiles(): | 22 for f in input_api.AffectedFiles(): |
23 for line_num, line in f.ChangedContents(): | 23 for line_num, line in f.ChangedContents(): |
24 m = pattern.match(line) | 24 m = pattern.match(line) |
25 if m and m.group(1) != '-blink': | 25 if m and m.group(1) != '-blink' and m.group(1) != '-shared': |
26 errors.append(' %s:%d %s' % ( | 26 errors.append(' %s:%d %s' % ( |
27 f.LocalPath(), line_num, line)) | 27 f.LocalPath(), line_num, line)) |
28 | 28 |
29 results = [] | 29 results = [] |
30 if errors: | 30 if errors: |
31 results.append(output_api.PresubmitError( | 31 results.append(output_api.PresubmitError( |
32 'Files that include non-Blink variant mojoms found:', errors)) | 32 'Files that include non-Blink variant mojoms found:', errors)) |
33 return results | 33 return results |
34 | 34 |
35 | 35 |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 new_description = description | 371 new_description = description |
372 new_description += '\nCQ_INCLUDE_TRYBOTS=%s' % ';'.join(bots) | 372 new_description += '\nCQ_INCLUDE_TRYBOTS=%s' % ';'.join(bots) |
373 results.append(output_api.PresubmitNotifyResult( | 373 results.append(output_api.PresubmitNotifyResult( |
374 'Automatically added slimming-paint-v2 tests to run on CQ due to ' | 374 'Automatically added slimming-paint-v2 tests to run on CQ due to ' |
375 'changes in paint or compositing directories.')) | 375 'changes in paint or compositing directories.')) |
376 | 376 |
377 if new_description != description: | 377 if new_description != description: |
378 rietveld_obj.update_description(issue, new_description) | 378 rietveld_obj.update_description(issue, new_description) |
379 | 379 |
380 return results | 380 return results |
OLD | NEW |