| skym | 0a8b662 | 2016-10-27 23:34:23 | [diff] [blame] | 1 | # Copyright 2016 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. |
| 4 | |
| 5 | """Presubmit script for sync_bookmarks component. |
| 6 | |
| 7 | See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts |
| 8 | for more details about the presubmit API built into depot_tools. |
| 9 | """ |
| 10 | |
| 11 | import re |
| 12 | |
| 13 | SYNC_BOOKMARKS_SOURCE_FILES = ( |
| 14 | r'^components[\\/]sync_bookmarks[\\/].*\.(cc|h)$',) |
| 15 | |
| 16 | def CheckChangeLintsClean(input_api, output_api): |
| 17 | source_filter = lambda x: input_api.FilterSourceFile( |
| Josip Sokcevic | 8b6cc43b | 2020-08-05 17:45:33 | [diff] [blame] | 18 | x, files_to_check=SYNC_BOOKMARKS_SOURCE_FILES, files_to_skip=None) |
| skym | 0a8b662 | 2016-10-27 23:34:23 | [diff] [blame] | 19 | return input_api.canned_checks.CheckChangeLintsClean( |
| Peter Kasting | 5118d12 | 2020-06-24 00:21:46 | [diff] [blame] | 20 | input_api, output_api, source_filter, lint_filters=[], verbose_level=1) |
| skym | 0a8b662 | 2016-10-27 23:34:23 | [diff] [blame] | 21 | |
| 22 | def CheckChanges(input_api, output_api): |
| 23 | results = [] |
| 24 | results += CheckChangeLintsClean(input_api, output_api) |
| skym | 0a8b662 | 2016-10-27 23:34:23 | [diff] [blame] | 25 | return results |
| 26 | |
| 27 | def CheckChangeOnUpload(input_api, output_api): |
| 28 | return CheckChanges(input_api, output_api) |
| 29 | |
| 30 | def CheckChangeOnCommit(input_api, output_api): |
| 31 | return CheckChanges(input_api, output_api) |