Commit graph

15 commits

Author SHA1 Message Date
Chih-Hung Hsieh
4275dcf866 Define CLANG_TIDY_UNKNOWN_CFLAGS in tidy.mk
* Moved from build/soong because the list is used only in make rules.

Bug: 111885396
Test: build with WITH_TIDY=1
Change-Id: I6ca7420e7ed1e342a5b92996724c6659a406d5ae
2018-08-22 09:21:53 -07:00
Dan Willemsen
425130e958 Remove configuration exported from Soong
Bug: 32244182
Test: build-aosp_angler.ninja is identical before/after (with same env)
Change-Id: Iec2784d1ec5301afe4e2de491dee806551ae3764
2016-10-31 15:48:00 -07:00
Chih-hung Hsieh
4b4b2da13d Merge "Accept environment variables DEFAULT_*_TIDY_CHECKS" 2016-10-04 22:25:26 +00:00
Chih-Hung Hsieh
8fdda6e495 Accept environment variables DEFAULT_*_TIDY_CHECKS
* Define DEFAULT_GLOBAL_TIDY_CHECKS/DEFAULT_EXTERNAL_VENDOR_TIDY_CHECKS
  only if it is not already defined.

Bug: http://b/27779618
Test: build with WITH_TIDY=1 and define those variables.
Change-Id: I201c9da3769d6ef658a75d4a1bf42ec6816d4069
2016-10-04 10:18:02 -07:00
Chih-Hung Hsieh
10efc73c06 Use DEFAULT_EXTERNAL_VENDOR_TIDY_CHECKS for vendor/google_devices
Many source files under vendor/google_devices
are old third party code with too many clang-tidy
misc-macro-parentheses warnings.

Test: build with WITH_TIDY=1
Change-Id: I79248af3ece9c7a4436b8cf5e6c25f224fd8201b
2016-09-30 14:50:43 -07:00
Dan Willemsen
69811f89d6 Remove spaces from DEFAULT_TIDY_HEADER_DIRS
I'm preparing to move this to Soong, and it's simpler to compare if the
spaces are removed here (to match the other lists in this file).

Test: WITH_TIDY=true; compare build.ninja before and after change
Change-Id: Ib27a19a36ebb1132300a8c1eeace1202685dfc4c
2016-09-26 16:02:15 -07:00
Chih-Hung Hsieh
0a33f65cc8 Define DEFAULT_TIDY_HEADER_DIRS.
Let clang-tidy report warnings in header files in the
system and current directories but not the external
and vendor directories.

Test: build with WITH_TIDY=1
Change-Id: I1723b8eb95948961fb7164a19989e0a926e5bf8a
2016-09-06 20:06:28 -07:00
Chih-Hung Hsieh
b9ea8d191d Suppress clang-tidy checks in frameworks/compile/mclinker.
Too many warnings need to wait for upstream changes.
Test: build with WITH_TIDY=1.

Change-Id: I0b1272049ad757670182668db130512a538b3096
2016-08-23 11:07:19 -07:00
Chih-Hung Hsieh
97032ccda3 Clarify default tidy check lists.
* Sort all enabled and disabled checks.
* Disable google-default-arguments for external and vendor projects.

Bug: http://b/27779618
Change-Id: I59e6eaf84fddf54bd89eb71a2189d73b64968057
Test: build with WITH_TIDY=1.
2016-08-16 15:47:56 -07:00
Chih-Hung Hsieh
fac1926481 Simplify DEFAULT_LOCAL_TIDY_CHECKS.
* Now each local directory path is matched against multiple
  patterns and only the last matched one will be used,
  or the DEFAULT_GLOBAL_TIDY_CHECKS is used.

Bug: http://b/27779618
Change-Id: I786e6cacd8a680a034b4bc09f561f658177d9b17
Test: build with WITH_TIDY=1.
2016-08-08 15:01:59 -07:00
Chih-Hung Hsieh
c868293abc Add performance* to default global tidy checks.
* This enables 5 performance related checks:
    performance-faster-string-find
    performance-for-range-copy
    performance-implicit-cast-in-loop
    performance-unnecessary-copy-initialization
    performance-unnecessary-value-param
* Recognize these new warnings in warn.py.

Bug: http://b/27779618
Change-Id: I7af3fdc262dd44db90d3b62eb37c5eac5a2eaa01
Test: build with WITH_TIDY=1 and run warn.py with build.log
2016-07-26 14:36:54 -07:00
Chih-Hung Hsieh
c21ddbdcce Recognize new clang and clang-tidy warnings.
* Count new clang-tidy warnings:
    google-runtime-references
    google-runtime-operator
* Count new clang warnings:
    -Wconst-conversion similar to -Wliteral-conversion
    -Wundefined-var-template
* Modified static analyzer warning message about
    "Null passed to a callee that requires a non-null ..."
* Disable google-runtime-references by default and
  disable misc-macro-parentheses in vendor projects;
  too many old C/C++ code have this warning.

Change-Id: Ib35e0af85875aada17c92b0237b76cd5ae3bfcc8
Test: build with clang-tidy.
2016-07-20 14:45:01 -07:00
Chih-Hung Hsieh
e1ea9434c1 Add misc-macro-parentheses to default tidy checks.
* Disable this check in external projects.

Bug: 28705665
Change-Id: Ia44a15765fd637dae36b5e0f2b59ee4280b139c9
2016-05-11 13:43:11 -07:00
Chih-Hung Hsieh
30f86e4ab8 Suppress google-* checks in vendor modules.
Too many warnings in vendor code that we cannot fix yet.

Bug: http://b/27779618
Change-Id: I8b65b1fd55c4e4d0dadf0617ab25962809237309
2016-04-29 15:16:59 -07:00
Chih-Hung Hsieh
460171a3e4 Add tidy.mk to set up global default checks.
* Default checks include only google* minus google-readability*.
* Some google-* checks are disabled for external projects.
* Each project can add more or disable checks through LOCAL_TIDY_CHECKS.

Bug: http://b/27779618
Change-Id: I83eed73bd2bddaace565a6dde532fb2036b4fac4
2016-04-25 12:17:03 -07:00