Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(406)

Side by Side Diff: android_webview/tools/PRESUBMIT.py

Issue 667723002: [Android WebView] Prepare the copyrights scanner to run from presubmit scripts (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a removed empty line Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 # Copyright 2014 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 def CheckChangeOnUpload(input_api, output_api):
6 return _CommonChecks(input_api, output_api)
7
8 def CheckChangeOnCommit(input_api, output_api):
9 return _CommonChecks(input_api, output_api)
10
11 def _CommonChecks(input_api, output_api):
12 """Checks common to both upload and commit."""
13 results = []
14
15 would_affect_tests = [
16 'PRESUBMIT.py',
17 'copyright_scanner.py',
18 'copyright_scanner_unittest.py'
19 ]
20 need_to_run_unittests = False
21 for f in input_api.AffectedFiles():
22 if any(t for t in would_affect_tests if f.LocalPath().endswith(t)):
23 need_to_run_unittests = True
24 break
25 tests = [input_api.os_path.join(
26 input_api.PresubmitLocalPath(), 'copyright_scanner_unittest.py')]
27 results.extend(
28 input_api.canned_checks.RunUnitTests(input_api, output_api, tests))
29 return results
OLDNEW
« no previous file with comments | « no previous file | android_webview/tools/copyright_scanner.py » ('j') | android_webview/tools/copyright_scanner.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698