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

Unified Diff: tools/android/checkstyle/checkstyle.py

Issue 862133002: Update from https://crrev.com/312398 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
Index: tools/android/checkstyle/checkstyle.py
diff --git a/tools/android/checkstyle/checkstyle.py b/tools/android/checkstyle/checkstyle.py
index 0c260bb9fb94c0022575027558277e6a6e9265b9..99a9fc9f0125c15ffc5ef6998b3e9ecdf47a1952 100644
--- a/tools/android/checkstyle/checkstyle.py
+++ b/tools/android/checkstyle/checkstyle.py
@@ -16,14 +16,15 @@ CHECKSTYLE_ROOT = os.path.join(CHROMIUM_SRC, 'third_party', 'checkstyle',
'checkstyle-6.1-all.jar')
-def RunCheckstyle(input_api, output_api, style_file):
+def RunCheckstyle(input_api, output_api, style_file, black_list=None):
if not os.path.exists(style_file):
file_error = (' Java checkstyle configuration file is missing: '
+ style_file)
return [output_api.PresubmitError(file_error)]
# Filter out non-Java files and files that were deleted.
- java_files = [x.LocalPath() for x in input_api.AffectedFiles(False, False)
+ java_files = [x.AbsoluteLocalPath() for x in input_api.AffectedSourceFiles(
+ lambda f: input_api.FilterSourceFile(f, black_list=black_list))
if os.path.splitext(x.LocalPath())[1] == '.java']
if not java_files:
return []
@@ -36,7 +37,7 @@ def RunCheckstyle(input_api, output_api, style_file):
CHECKSTYLE_ROOT,
'com.puppycrawl.tools.checkstyle.Main', '-c',
style_file, '-f', 'xml'] + java_files,
- stdout=subprocess.PIPE, env=checkstyle_env)
+ stdout=subprocess.PIPE, env=checkstyle_env)
stdout, _ = check.communicate()
except OSError as e:
import errno

Powered by Google App Engine
This is Rietveld 408576698