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

Side by Side Diff: build/android/findbugs_filter/PRESUBMIT.py

Issue 11583028: Add a presubmit check to check that a certain set of Android specific files only have deletions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved the PRESUBMIT.py per suggestion Created 7 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright (c) 2013 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
6 _DELETIONS_ONLY_FILES = (
7 'build/android/findbugs_filter/findbugs_known_bugs.txt',
M-A Ruel 2013/01/15 02:16:23 I thought the path was corrected to you should use
8 )
9
10
11 def _CheckDeletionsOnlyFiles(input_api, output_api):
12 """Check that a certain listed files only have deletions.
13 """
14 errors = []
15 for f in input_api.AffectedFiles():
16 if f.LocalPath() in _DELETIONS_ONLY_FILES:
17 if f.ChangedContents():
18 errors.append(f.LocalPath())
19 results = []
20 if errors:
21 results.append(output_api.PresubmitError(
22 'Following files should only contain deletions.', errors))
23 return results
24
25
26 def CommonChecks(input_api, output_api):
27 output = []
28 output.extend(input_api.canned_checks.RunPylint(
29 input_api,
30 output_api,
31 white_list=[r'PRESUBMIT\.py$'],
32 extra_paths_list=[]))
33
34 output.extend(_CheckDeletionsOnlyFiles(input_api, output_api))
35 return output
36
37
38 def CheckChangeOnUpload(input_api, output_api):
39 return CommonChecks(input_api, output_api)
40
41
42 def CheckChangeOnCommit(input_api, output_api):
43 return CommonChecks(input_api, output_api)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698