summaryrefslogtreecommitdiff
path: root/tools/warn/other_warn_patterns.py
diff options
context:
space:
mode:
author Chih-hung Hsieh <chh@google.com> 2020-01-07 21:49:01 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2020-01-07 21:49:01 +0000
commit3a59a5f66adbaf1da1112f57dc679870e8ed1b2c (patch)
tree06b3d5902d4cf5f9dfc3df7606134875af01d97a /tools/warn/other_warn_patterns.py
parent42f2c761bfd079ea9570dd8aa50cc1b64ed7e1db (diff)
parenta9f7746f29c528cffd4809976ba711a96dd747d8 (diff)
Merge "Add new compiler warning patterns"
Diffstat (limited to 'tools/warn/other_warn_patterns.py')
-rw-r--r--tools/warn/other_warn_patterns.py24
1 files changed, 14 insertions, 10 deletions
diff --git a/tools/warn/other_warn_patterns.py b/tools/warn/other_warn_patterns.py
index 45d14dc5e7..524673e4f1 100644
--- a/tools/warn/other_warn_patterns.py
+++ b/tools/warn/other_warn_patterns.py
@@ -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',