diff --git a/tools/warn/java_warn_patterns.py b/tools/warn/java_warn_patterns.py index 3a3a676e2..0a443d483 100644 --- a/tools/warn/java_warn_patterns.py +++ b/tools/warn/java_warn_patterns.py @@ -93,6 +93,8 @@ warn_patterns = [ [r".*: warning: \[MultipleTopLevelClasses\] .+"]), java_low('Avoid having multiple unary operators acting on the same variable in a method call', [r".*: warning: \[MultipleUnaryOperatorsInMethodCall\] .+"]), + java_low('OnNameExpected naming style', + [r".*\.java:.*: warning: .+ \[OnNameExpected\]$"]), java_low('Package names should match the directory they are declared in', [r".*: warning: \[PackageLocation\] .+"]), java_low('Non-standard parameter comment; prefer `/* paramName= */ arg`', diff --git a/tools/warn/other_warn_patterns.py b/tools/warn/other_warn_patterns.py index 1331bc603..19a4e3862 100644 --- a/tools/warn/other_warn_patterns.py +++ b/tools/warn/other_warn_patterns.py @@ -46,6 +46,10 @@ def kotlin(description, pattern_list): return warn('Kotlin', Severity.MEDIUM, description, pattern_list) +def yacc(description, pattern_list): + return warn('yacc', Severity.MEDIUM, description, pattern_list) + + warn_patterns = [ # pylint:disable=line-too-long,g-inconsistent-quotes # aapt warnings @@ -115,6 +119,14 @@ warn_patterns = [ kotlin('library has Kotlin runtime', [r".*: warning: library has Kotlin runtime bundled into it", r".*: warning: some JAR files .* have the Kotlin Runtime library"]), + # Yacc warnings + yacc('deprecate directive', + [r".*\.yy?:.*: warning: deprecated directive: "]), + yacc('shift/reduce conflicts', + [r".*\.yy?: warning: .+ shift/reduce conflicts "]), + {'category': 'yacc', 'severity': Severity.SKIP, + 'description': 'yacc: fix-its can be applied', + 'patterns': [r".*\.yy?: warning: fix-its can be applied."]}, # Rust warnings {'category': 'Rust', 'severity': Severity.HIGH, 'description': 'Rust: Does not derive Copy', diff --git a/tools/warn/warn_common.py b/tools/warn/warn_common.py index b885ad2f6..0c9d9efbb 100755 --- a/tools/warn/warn_common.py +++ b/tools/warn/warn_common.py @@ -199,22 +199,30 @@ html_head_scripts = """\ """ +def make_writer(output_stream): + + def writer(text): + return output_stream.write(text + '\n') + + return writer + + def html_big(param): return '' + param + '' -def dump_html_prologue(title): - print('\n
') - print('') +def dump_html_prologue(title, writer): + writer('\n
') + writer('') -def dump_html_epilogue(): - print('\n\n') +def dump_html_epilogue(writer): + writer('\n\n