From 31dba778fca246a40e4fe5a6a04ff148541cdcdd Mon Sep 17 00:00:00 2001 From: Henri Chataing Date: Fri, 18 Oct 2024 14:33:17 -0700 Subject: Add bluetooth_tidy default Enforces clang-tidy checks for all cc targets Bug: 331817295 Test: m com.android.btservices Flag: EXEMPT, build change Change-Id: I91f0a12aa06d12ad1dcbdf23ae67d3948ac66c25 --- Android.bp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'Android.bp') diff --git a/Android.bp b/Android.bp index 9fbf29d0df..7fbd19909a 100644 --- a/Android.bp +++ b/Android.bp @@ -75,6 +75,27 @@ cc_defaults { cpp_std: "c++20", } +// List of tidy checks that are enabled for cc targets. +// Note that the goal is not to enable all checks, many of them will +// appear as noise especially in the modernize-* range. +bluetooth_tidy_checks = [ + "-*", + "misc-*", + + // This check implements detection of local variables which could be declared + // as const but are not. + "-misc-const-correctness", +] + +// This default tidy checks that will be run against all the cc targets +// developed by the Bluetooth team. +cc_defaults { + name: "bluetooth_tidy", + tidy: true, + tidy_checks: bluetooth_tidy_checks, + tidy_checks_as_errors: bluetooth_tidy_checks, +} + java_defaults { name: "bluetooth_errorprone_rules", errorprone: { -- cgit v1.2.3-59-g8ed1b