blob: e2f86017807d7cb570262c6d853dee7f5fd304b3 [file] [log] [blame]
Avi Drissman8ba1bad2022-09-13 19:22:361# Copyright 2016 The Chromium Authors
skym0a8b6622016-10-27 23:34:232# 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 browser_sync 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
13BROWSER_SYNC_SOURCE_FILES = (r'^components[\\/]browser_sync[\\/].*\.(cc|h)$',)
14
15def CheckChangeLintsClean(input_api, output_api):
16 source_filter = lambda x: input_api.FilterSourceFile(
Josip Sokcevic8b6cc432020-08-05 17:45:3317 x, files_to_check=BROWSER_SYNC_SOURCE_FILES, files_to_skip=None)
skym0a8b6622016-10-27 23:34:2318 return input_api.canned_checks.CheckChangeLintsClean(
Peter Kasting5118d122020-06-24 00:21:4619 input_api, output_api, source_filter, lint_filters=[], verbose_level=1)
skym0a8b6622016-10-27 23:34:2320
21def CheckChanges(input_api, output_api):
22 results = []
23 results += CheckChangeLintsClean(input_api, output_api)
skym0a8b6622016-10-27 23:34:2324 return results
25
26def CheckChangeOnUpload(input_api, output_api):
27 return CheckChanges(input_api, output_api)
28
29def CheckChangeOnCommit(input_api, output_api):
30 return CheckChanges(input_api, output_api)