From 98b285dafb90b7136dadc55c534888e7155205b1 Mon Sep 17 00:00:00 2001 From: Chih-Hung Hsieh Date: Wed, 28 Apr 2021 14:49:32 -0700 Subject: Fix/suppress most pylint and gpylint warnings * Add missing function doc strings. Suppress this warning on trivial functions in *_warn_patterns.py. * Remove unused g-importing-memeber, g-complex-comprehension. * Suppress pylint warning on unrecognized g-* options. * Suppress too-few-public-methods warnings on simple classes. * Suppress too-many-arguments and missing-function-docstring in html_writer.py, which will be refactored later. * Fix bad naming, long lines and line breaks, and bad quotes. Test: compare output for build.log Change-Id: Icdb34f014a10ec1e642c2cfe8003fc3ae245b507 --- tools/warn/cpp_warn_patterns.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'tools/warn/cpp_warn_patterns.py') diff --git a/tools/warn/cpp_warn_patterns.py b/tools/warn/cpp_warn_patterns.py index e8783bc476..2fa9916eca 100644 --- a/tools/warn/cpp_warn_patterns.py +++ b/tools/warn/cpp_warn_patterns.py @@ -15,10 +15,12 @@ """Warning patterns for C/C++ compiler, but not clang-tidy.""" +# No need of doc strings for trivial small functions. +# pylint:disable=missing-function-docstring + import re # pylint:disable=relative-beyond-top-level -# pylint:disable=g-importing-member from .severity import Severity @@ -56,7 +58,8 @@ def harmless(description, pattern_list): warn_patterns = [ - # pylint:disable=line-too-long,g-inconsistent-quotes + # pylint does not recognize g-inconsistent-quotes + # pylint:disable=line-too-long,bad-option-value,g-inconsistent-quotes medium('Implicit function declaration', [r".*: warning: implicit declaration of function .+", r".*: warning: implicitly declaring library function"]), @@ -300,7 +303,7 @@ warn_patterns = [ medium('Missing noreturn', [r".*: warning: function '.*' could be declared with attribute 'noreturn'"]), medium('User warning', - [r".*: warning: #warning "".+"""]), + [r".*: warning: #warning \".+\""]), medium('Vexing parsing problem', [r".*: warning: empty parentheses interpreted as a function declaration"]), medium('Dereferencing void*', -- cgit v1.2.3-59-g8ed1b