Add new compiler warning patterns

* Mostly new Java and Kotlin warnings found in nightly builds.
* More clean up of Java and C++ warning patterns will follow.

Test: warn.py --url=http://cs/android --separator='?l=' build.log > warnings.html
Change-Id: I8776401d15c3a59535722d52a5eec03f954d3b15
This commit is contained in:
Chih-Hung Hsieh
2020-01-06 12:02:27 -08:00
parent 99202ec0a6
commit a9f7746f29
3 changed files with 40 additions and 13 deletions

View File

@@ -39,6 +39,10 @@ def asm(description, pattern_list):
return warn('asm', Severity.MEDIUM, description, pattern_list)
def kotlin(description, pattern_list):
return warn('Kotlin', Severity.MEDIUM, description, pattern_list)
patterns = [
# pylint:disable=line-too-long,g-inconsistent-quotes
# aapt warnings
@@ -96,16 +100,16 @@ patterns = [
'description': 'Proto: Import not used',
'patterns': [r".*: warning: Import .*/.*\.proto but not used.$"]},
# Kotlin warnings
{'category': 'Kotlin', 'severity': Severity.MEDIUM,
'description': 'Kotlin: never used parameter or variable',
'patterns': [r".*: warning: (parameter|variable) '.*' is never used$"]},
{'category': 'Kotlin', 'severity': Severity.MEDIUM,
'description': 'Kotlin: Deprecated in Java',
'patterns': [r".*: warning: '.*' is deprecated. Deprecated in Java"]},
{'category': 'Kotlin', 'severity': Severity.MEDIUM,
'description': 'Kotlin: library has Kotlin runtime',
'patterns': [r".*: warning: library has Kotlin runtime bundled into it",
r".*: warning: some JAR files .* have the Kotlin Runtime library"]},
kotlin('never used parameter or variable',
[r".*\.kt:.*: warning: (parameter|variable) '.*' is never used$",
r".*\.kt:.*: warning: (parameter|variable) '.*' is never used, could be renamed to _$"]),
kotlin('unchecked cast',
[r".*\.kt:.*: warning: unchecked cast: .* to .*$"]),
kotlin('Deprecated in Java',
[r".*\.kt:.*: warning: '.*' is deprecated. Deprecated in Java"]),
kotlin('library has Kotlin runtime',
[r".*: warning: library has Kotlin runtime bundled into it",
r".*: warning: some JAR files .* have the Kotlin Runtime library"]),
# Rust warnings
{'category': 'Rust', 'severity': Severity.HIGH,
'description': 'Rust: Does not derive Copy',