blob: ae36e5246450b5bc50545193d33e4ff2764b4e5c [file] [log] [blame]
skym0a8b6622016-10-27 23:34:231# 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
7See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
8for more details about the presubmit API built into depot_tools.
9"""
10
11import re
12
13SYNC_BOOKMARKS_SOURCE_FILES = (
14 r'^components[\\/]sync_bookmarks[\\/].*\.(cc|h)$',)
15
16def CheckChangeLintsClean(input_api, output_api):
17 source_filter = lambda x: input_api.FilterSourceFile(
Josip Sokcevic8b6cc43b2020-08-05 17:45:3318 x, files_to_check=SYNC_BOOKMARKS_SOURCE_FILES, files_to_skip=None)
skym0a8b6622016-10-27 23:34:2319 return input_api.canned_checks.CheckChangeLintsClean(
Peter Kasting5118d122020-06-24 00:21:4620 input_api, output_api, source_filter, lint_filters=[], verbose_level=1)
skym0a8b6622016-10-27 23:34:2321
22def CheckChanges(input_api, output_api):
23 results = []
24 results += CheckChangeLintsClean(input_api, output_api)
skym0a8b6622016-10-27 23:34:2325 return results
26
27def CheckChangeOnUpload(input_api, output_api):
28 return CheckChanges(input_api, output_api)
29
30def CheckChangeOnCommit(input_api, output_api):
31 return CheckChanges(input_api, output_api)