OLD | NEW |
1 # Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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 """Presubmit script for sync component. | 5 """Presubmit script for sync component. |
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 depot_tools. | 8 for more details about the presubmit API built into depot_tools. |
9 """ | 9 """ |
10 | 10 |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 def CheckChangeLintsClean(input_api, output_api): | 370 def CheckChangeLintsClean(input_api, output_api): |
371 source_filter = lambda x: input_api.FilterSourceFile( | 371 source_filter = lambda x: input_api.FilterSourceFile( |
372 x, white_list=SYNC_SOURCE_FILES, black_list=None) | 372 x, white_list=SYNC_SOURCE_FILES, black_list=None) |
373 return input_api.canned_checks.CheckChangeLintsClean( | 373 return input_api.canned_checks.CheckChangeLintsClean( |
374 input_api, output_api, source_filter, lint_filters=LINT_FILTERS, | 374 input_api, output_api, source_filter, lint_filters=LINT_FILTERS, |
375 verbose_level=1) | 375 verbose_level=1) |
376 | 376 |
377 def CheckChanges(input_api, output_api): | 377 def CheckChanges(input_api, output_api): |
378 results = [] | 378 results = [] |
379 results += CheckChangeLintsClean(input_api, output_api) | 379 results += CheckChangeLintsClean(input_api, output_api) |
380 results += input_api.canned_checks.CheckPatchFormatted(input_api, output_api) | |
381 for f in input_api.AffectedFiles(): | 380 for f in input_api.AffectedFiles(): |
382 if f.LocalPath().endswith(MODEL_TYPE_FILE_NAME): | 381 if f.LocalPath().endswith(MODEL_TYPE_FILE_NAME): |
383 return CheckModelTypeInfoMap(input_api, output_api, f) | 382 return CheckModelTypeInfoMap(input_api, output_api, f) |
384 return results | 383 return results |
385 | 384 |
386 def CheckChangeOnUpload(input_api, output_api): | 385 def CheckChangeOnUpload(input_api, output_api): |
387 return CheckChanges(input_api, output_api) | 386 return CheckChanges(input_api, output_api) |
388 | 387 |
389 def CheckChangeOnCommit(input_api, output_api): | 388 def CheckChangeOnCommit(input_api, output_api): |
390 return CheckChanges(input_api, output_api) | 389 return CheckChanges(input_api, output_api) |
OLD | NEW |