Commit graph

29 commits

Author SHA1 Message Date
Chih-Hung Hsieh
02f0df83fc Lower severity of 3 tidy warnings
* bcmp/bcopy/bzero are not insecureAPI on Android.
* Android projects may enable/disable clang-tidy checks locally;
  warn/*patterns.py keep global classification of all warnings.

Test: warn.py --url=http://cs/android --separator='?l=' build.log > warnings.html
Test: warn.py --gencsv build.log > warnings.csv
Change-Id: I7720f7babd0a33c1b6602c9a8bb67565c45db94e
2022-01-20 16:13:12 -08:00
Chih-Hung Hsieh
d4691ecfb6 Show directories and files with most warnings.
* Now with 4 sections that can be shown/hidden independently.
* After the 'selected_projects' section, add two more sections:
  * 'top_directory_section' contains
    * a table of directories with at least 1% warnings.
    * a 'selected_directory_warnings' subsection to show all warnings
      in the clicked directory from the directory table
  * 'top_file_section' contains
    * a table of files with at least 100 or 1% warnings.
    * a 'selected_file_warnings' subsection to show all warnings
      in the clicked file from the file table
* Adjust button/section spaces and reduce button font size to 100%.
* Rename drawTable to genTables.

Test: warn.py --url=http://cs/android --separator='?l=' build.log > warnings.html
Test: warn.py --gencsv build.log > warnings.csv
Change-Id: I765b09a46adc111cfe781719ba7aa0f917aa6ffc
2022-01-05 15:43:52 -08:00
Chih-Hung Hsieh
f36e01de61 Add new clang-tidy and clang warning patterns
* New "clang-tidy used ... seconds" warnings are reported when
  clang-tidy runs for more than 1/2 of TIDY_TIMEOUT seconds.
* Recognize other clang-tidy warnings in separate groups;
  they should not be used in normal Android builds.
* Add two more variants of C++ warnings.

Test: warn.py --url=http://cs/android --separator='?l=' build.log > warnings.html
Test: warn.py --gencsv build.log > warnings.csv
Change-Id: I4a2e1c3c817c586cfe3da125b920cca77fcc63b6
2021-10-08 13:18:24 -07:00
Chih-Hung Hsieh
3bb6c9448b Add new clang and clang-tidy warning patterns
* New "clang-tidy aborted ..." warnings are reported when
  clang-tidy runs for more than TIDY_TIMEOUT seconds.

Test: warn.py --url=http://cs/android --separator='?l=' build.log > warnings.html
Test: warn.py --gencsv build.log > warnings.csv
Change-Id: Iea62b06b2cf78737d7713dabbcf6d9ac8ba23898
2021-09-23 13:51:08 -07:00
Chih-Hung Hsieh
77e3146600 Handle warning lines from RBE
* Recognize USE_RBE special environment variable.
  * Remove RBE special file path prefix /b/f/w/
    and any leading characters.
  * Only do this for android now, maybe for chrome later.
* When finding android_root, do not use
  /b/f/w/ and /tmp/ file paths.
* Recognize BUILD_ID and add it into .html output.
* Style improvement with continue statements.

Test: warn.py --url=http://cs/android --separator='?l=' build.log > warnings.html
Test: warn.py --gencsv build.log > warnings.csv
Bug: 198657613
Change-Id: I57746f026d5d8b71e792127b8d6ba15f6b28103c
2021-09-03 14:23:55 -07:00
Chih-Hung Hsieh
56aa27bf12 Add one more Java warning pattern
Test: warn.py --url=http://cs/android --separator='?l=' build.log > warnings.html
Test: warn.py --gencsv build.log > warnings.csv
Change-Id: Ibc0ef7d1df29485ab4389f5c595fac77f69e19e7
2021-06-10 14:33:54 -07:00
Chih-Hung Hsieh
e40e2bf8db Add one Asm warning pattern
Test: warn.py --url=http://cs/android --separator='?l=' build.log > warnings.html
Test: warn.py --gencsv build.log > warnings.csv
Change-Id: I85b53c15b5a9e705e939e2cf810a0344df6dbeda
2021-06-08 14:52:45 -07:00
Chih-Hung Hsieh
5d9ee04f56 Add new Asm/C++/Java/Make warning patterns
* Change some incorrectly-classified logtags warnings to C++.
* Fix gpylint warnings of long lines in html_writer.py.

Test: warn.py --url=http://cs/android --separator='?l=' build.log > warnings.html
Test: warn.py --gencsv build.log > warnings.csv
Change-Id: I98c01dadfd72b202d81ef7c94e93c42182f6065c
2021-06-02 21:34:49 +00:00
Chih-Hung Hsieh
a606822f35 Fix more pylint warnings.
* add .pylintrc to use 2 space indentation
* rename single-letter local variables

Test: ./warn.py build.log > warnings.html
Change-Id: I2ca56a6cb130a9d6c73328c5592ad7cde8a974ab
2021-04-30 14:32:25 -07:00
Chih-Hung Hsieh
98b285dafb 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
2021-04-28 14:57:56 -07:00
Chih-Hung Hsieh
7cc0e15e4a Use python3
Test: warn.py build.log > warnings.html
Change-Id: I781ea7bfe023ec5af829757c417bc70aba80af0d
2021-04-26 17:09:36 -07:00
Saeid Farivar Asanjan
75dc8d2dab Dump a new CSV with warning messages
Bug: 171068870
Test: manual
Change-Id: Ibb528940daf9a6cd99ece8e5a63d67aacdfc131c
2020-11-24 05:46:33 +00:00
Baligh Uddin
4dc00c60da Move {libbacktrace,libunwindstack} from system/core -> system/unwinding/
BUG: 170465278
Test: TH
Change-Id: I7f0d7b1254e7a28a55599aa4ee6bb6f2ac789b60
2020-10-27 19:44:34 +00:00
Baligh Uddin
84280dfa4c Cleanup references to system/core/liblog -> system/logging/liblog
BUG: 170387172
Test: TH
Change-Id: I206a8c43ba914381771826518f369bad328cc257
2020-10-26 14:34:45 +00:00
Baligh Uddin
71fab5c75a Cleanup references to system/core/base -> system/libbase
BUG: 157656545
Test: TH
Change-Id: I0dc00f5f90cfdf439e3dc5d63e5aff178b1e9206
2020-10-23 14:40:36 +00:00
Chih-Hung Hsieh
e8f4a716ad Add new Java/C++/Yacc warning patterns
Test: warn.py --url=http://cs/android --separator='?l=' build.log > warnings.html
Test: warn.py --gencsv build.log > warnings.csv
Change-Id: I49eafa322902f0587738b583b6262117595318ee
2020-09-18 21:51:06 -07:00
Jeff Sharkey
2a5b9342f0 Merge "Split MediaProvider into its own target." into rvc-dev am: f068a60e8a
Change-Id: I7efc2e73ce5798c19432f4004b7cf913599ccbd1
2020-05-05 15:37:01 +00:00
Jeff Sharkey
7a3c61259e Split MediaProvider into its own target.
As we move towards becoming a Mainline module, it's important that
we catch as many bugs as possible during initial code review, and
Error Prone is designed to do exactly that.

Instead of lumping ourselves into the generic "packages" grouping,
this change adds a specific package for this Mainline module.

Bug: 142561358
Test: ./build/soong/soong_ui.bash --make-mode MediaProviderLegacy com.google.android.mediaprovider MediaProviderTests RUN_ERROR_PRONE=true
Change-Id: I62102febe39225a54c77d9ad463c350b3df9cafa
2020-05-03 11:36:17 -06:00
Chih-Hung Hsieh
3cce2bcc60 Separate html/csv output functions into html_writer.py
* also suppress some pylint warnings

Test: warn.py --url=http://cs/android --separator='?l=' build.log > warnings.html
Test: warn.py --gencsv build.log > warnings.csv
Change-Id: I497dbb7496ca21470ba33db03eedb27f5e8f1e96
2020-02-27 15:39:18 -08:00
Chih-Hung Hsieh
445ad810c8 Recognize more warning patterns.
* add more Java, Kotlin, and Rust warning patterns
* recognize more clang-tidy cert-* and bugprone-* warnings;
  still keep the catch-all 'cert' and 'bugprone' groups.

Test: warn.py build.log > warnings.html
Change-Id: I909ec09822f42f60493ebe943c055bf0d4b69938
2020-02-26 14:34:21 -08:00
Chih-Hung Hsieh
5ae5519661 Use same warn_common.py and warn.py for Android and Chrome
* add chrome_project_list.py
* use newer Chrome's warn_common.py and severity.py
* modify warn_common.py to work with both python2 and python3,
  to work with and without google3

Test: warn.py --url=http://cs/android --separator='?l=' build.log > warnings.html
Test: warn.py --gencsv build.log > warnings.csv
Change-Id: I9aeee7031c11988d8ead1733ff4846ae6cb1ee73
2020-02-25 19:47:35 -08:00
Chih-Hung Hsieh
ed74896600 More Java/Kotlin warning patterns
* Simplify java warning pattern functions.

Test: warn.py --url=http://cs/android --separator='?l=' build.log > warnings.html
Test: warn.py --gencsv build.log > warnings.csv
Change-Id: I837fa9290acded3b936182877d9e0c00de4cdf4f
2020-02-04 15:34:12 -08:00
Chih-Hung Hsieh
a7f5f3fcbb Add new Java/Kotlin/Make warning patterns
Test: warn.py --url=http://cs/android --separator='?l=' build.log > warnings.html
Test: warn.py --gencsv build.log > warnings.csv
Change-Id: I3195999d60f268f105ead022c193319de4af4e64
2020-01-31 16:14:04 -08:00
Chih-Hung Hsieh
b09530bd65 Add new C++ and Java warning patterns
Test: warn.py --url=http://cs/android --separator='?l=' build.log > warnings.html
Test: warn.py --gencsv build.log > warnings.csv
Change-Id: I11457fdab7abd475e835367582c0b9aab11cfe6f
2020-01-29 11:01:36 -08:00
Chih-Hung Hsieh
5392cdbeb1 Call a writer to dump html; new warning patterns.
* HTML emit functions now take a writer parameter.
  This makes warn_common.py one step closer to the ChromeOS version.
* Add new found warning patterns from java and yacc.

Test: warn.py --url=http://cs/android --separator='?l=' build.log > warnings.html
Test: warn.py --gencsv build.log > warnings.csv
Change-Id: I5c446ca767746598f07603591fdf98f7d82cae17
2020-01-14 11:57:12 -08:00
Chih-Hung Hsieh
8724ff72ef Clean up cpp warning patterns
* Remove the useless 'option' key.
  It is only used in some C/C++ warning patterns
  to give a hint of options to turn to -Werror.
  Now the global default is -Werror.
* Factor out common code patterns into high/medium/low functions.

Test: warn.py --url=http://cs/android --separator='?l=' build.log > warnings.html
Test: warn.py --gencsv build.log > warnings.csv
Change-Id: Ibd3f768b1552ada925eb5afb0f01ab674c968a87
2020-01-13 11:10:54 -08:00
Chih-Hung Hsieh
949205a661 Use new Severity class and update *_warn_patterns
* This new class definition and patterns are
  shared between Android and ChromeOS compiler tools.
* Suppress hard to fix and false positive linter warnings.

Test: warn.py --url=http://cs/android --separator='?l=' build.log > warnings.html
Test: warn.py --gencsv build.log > warnings.csv
Change-Id: Icb47809100ad30796cb1da82610e989d450194fa
2020-01-10 15:21:20 -08:00
Chih-Hung Hsieh
a9f7746f29 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
2020-01-06 12:11:44 -08:00
Chih-Hung Hsieh
888d143e4c Split warn.py into multiple files
* Split warning patterns into *_warn_patterns.py
* Split project list into android_project_list.py
* Split out the Severity class, to be changed later
* Split core of warn.py into warn_common.py and
  leave only platform dependent code in warn.py.
  This allows the core logic be used with different
  parallel processing libraries.
* Old warn.py just calls -m warn.warn.

Test: path_to_build/tools/warn.py build.log
Test: warn.py --url=http://cs/android --separator='?l=' build.log > warnings.html
Change-Id: I6734e4472a21018cd5ce06d549f6dbca24f4de54
2019-12-17 15:12:31 -08:00