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

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

Issue 2820583002: Reland "Update third_party/checkstyle to 7.6.1" (Closed)
Patch Set: nit Created 3 years, 8 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
« no previous file with comments | « third_party/checkstyle/checkstyle-7.6.1-all.jar.sha1 ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/android/checkstyle/checkstyle.py
diff --git a/tools/android/checkstyle/checkstyle.py b/tools/android/checkstyle/checkstyle.py
index 44e1ecf5f122a5d45587685fd92c5690af613173..24338504b3513da5c4a7d169b6f576f8b4578b6b 100644
--- a/tools/android/checkstyle/checkstyle.py
+++ b/tools/android/checkstyle/checkstyle.py
@@ -13,7 +13,15 @@ CHROMIUM_SRC = os.path.normpath(
os.path.join(os.path.dirname(__file__),
os.pardir, os.pardir, os.pardir))
CHECKSTYLE_ROOT = os.path.join(CHROMIUM_SRC, 'third_party', 'checkstyle',
- 'checkstyle-6.5-all.jar')
+ 'checkstyle-7.6.1-all.jar')
+
+
+def FormatCheckstyleOutput(checkstyle_output):
+ lines = checkstyle_output.splitlines(True)
+ if 'Checkstyle ends with' in lines[-1]:
+ return ''.join(lines[:-1])
+ else:
+ return checkstyle_output
def RunCheckstyle(input_api, output_api, style_file, black_list=None):
@@ -49,8 +57,10 @@ def RunCheckstyle(input_api, output_api, style_file, black_list=None):
result_errors = []
result_warnings = []
+ formatted_checkstyle_output = FormatCheckstyleOutput(stdout)
+
local_path = input_api.PresubmitLocalPath()
- root = xml.dom.minidom.parseString(stdout)
+ root = xml.dom.minidom.parseString(formatted_checkstyle_output)
for fileElement in root.getElementsByTagName('file'):
fileName = fileElement.attributes['name'].value
fileName = os.path.relpath(fileName, local_path)
« no previous file with comments | « third_party/checkstyle/checkstyle-7.6.1-all.jar.sha1 ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698