Fix and suppress a bunch of lint warnings to be able to enable
lint build failing.

TBR=boliu@chromium.org,pauljensen@chromium.org,tedchoc@chromium.org,lambroslambrou@chromium.org,damienv@chromium.org
BUG=501471,241521,501591,501593,501900,502030

Review URL: https://codereview.chromium.org/1190103002

Cr-Original-Commit-Position: refs/heads/master@{#335371}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 8db283ac6beb49ad8032a8e6c65e4cc76db65ffd
This commit is contained in:
aurimas 2015-06-19 15:38:49 -07:00 коммит произвёл Commit bot
Родитель 6978e56fe0
Коммит b2069d66aa
3 изменённых файлов: 17 добавлений и 8 удалений

Просмотреть файл

@ -20,8 +20,7 @@ _SRC_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__),
def _RunLint(lint_path, config_path, processed_config_path, manifest_path,
result_path, product_dir, sources, jar_path, resource_dir=None,
can_fail_build=False):
result_path, product_dir, sources, jar_path, resource_dir=None):
def _RelativizePath(path):
"""Returns relative path to top-level src dir.
@ -122,7 +121,7 @@ def _RunLint(lint_path, config_path, processed_config_path, manifest_path,
if not os.path.exists(result_path):
print 'Something is wrong:'
print e
return 0
return 1
# There are actual lint issues
else:
@ -133,7 +132,7 @@ def _RunLint(lint_path, config_path, processed_config_path, manifest_path,
print 'File contents:'
with open(result_path) as f:
print f.read()
return 0
return 1
_ProcessResultFile()
msg = ('\nLint found %d new issues.\n'
@ -148,7 +147,7 @@ def _RunLint(lint_path, config_path, processed_config_path, manifest_path,
'lint', 'suppress.py')),
_RelativizePath(result_path)))
print >> sys.stderr, msg
return 1 if can_fail_build else 0
return 1
return 0
@ -198,7 +197,7 @@ def main():
options.processed_config_path,
options.manifest_path, options.result_path,
options.product_dir, sources, options.jar_path,
options.resource_dir, options.can_fail_build)
options.resource_dir)
if options.depfile:
build_utils.WriteDepfile(
@ -208,7 +207,7 @@ def main():
if options.stamp and not rc:
build_utils.Touch(options.stamp)
return rc
return rc if options.can_fail_build else 0
if __name__ == '__main__':

Просмотреть файл

@ -53,10 +53,14 @@ Still reading?
<ignore path="ui/android/java/res/drawable-xxxhdpi"/>
<ignore regexp=".*: reader_mode_bar_background.9.png, tabs_moved_htc.png, tabs_moved_nexus.png, tabs_moved_samsung.png$"/>
</issue>
<!-- It is OK for content_shell_apk and chrome_shell_apk to have missing assets. -->
<issue id="IconLocation">
<!-- It is OK for content_shell_apk and chrome_shell_apk to have missing assets. -->
<ignore path="content/shell/android/java/res/"/>
<ignore path="chrome/android/shell/res/"/>
<!-- Suppression for chrome/test/chromedriver/test/webview_shell/java/res/drawable/icon.png -->
<ignore path="res/drawable/icon.png"/>
<!-- TODO(lambroslambrou) remove this once crbug.com/502030 is fixed. -->
<ignore path="remoting/android/java/res"/>
</issue>
<issue id="InconsistentLayout" severity="ignore"/>
<issue id="InflateParams" severity="ignore"/>
@ -73,11 +77,14 @@ Still reading?
<ignore path="org/chromium/base/SysUtils.class"/>
<ignore path="org/chromium/chrome/browser/TtsPlatformImpl.class"/>
<ignore path="org/chromium/chrome/browser/TtsPlatformImpl$*.class"/>
<ignore path="chrome/android/java/res/values-v17/styles.xml"/>
</issue>
<issue id="OldTargetApi">
<ignore path="AndroidManifest.xml"/>
</issue>
<issue id="Overdraw" severity="ignore"/>
<!-- TODO(newt): remove if INJECT_EVENTS is not needed crbug.com/502028 -->
<issue id="ProtectedPermissions" severity="ignore"/>
<issue id="Recycle" severity="ignore"/>
<issue id="Registered" severity="ignore"/>
<issue id="RtlCompat" severity="ignore"/>
@ -93,6 +100,8 @@ Still reading?
targets have been merged. crbug.com/484934
-->
<ignore path="chrome/android/java/res" />
<ignore path="content/shell/android/shell_apk/res/layout/content_shell_activity.xml" />
<ignore path="content/shell/android/shell_apk/res/values/strings.xml" />
</issue>
<issue id="SignatureOrSystemPermissions" severity="ignore"/>
<issue id="UnusedAttribute" severity="ignore"/>

Просмотреть файл

@ -36,6 +36,7 @@
'--product-dir=<(PRODUCT_DIR)',
'--src-dirs=>(src_dirs)',
'--jar-path=<(lint_jar_path)',
'--can-fail-build',
'--stamp=<(stamp_path)',
'<(is_enabled)',
],