Loading .clang-tidy 0 → 100644 +4 −0 Original line number Diff line number Diff line --- CheckOptions: - key: misc-include-cleaner.IgnoreHeaders value: (fmt/.*|bits/pthread_types\.h) Android.bp +21 −0 Original line number Diff line number Diff line Loading @@ -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: { Loading system/build/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ cc_defaults { name: "fluoride_defaults", defaults: [ "bluetooth_cflags", "bluetooth_tidy", ], cflags: [ "-DEXPORT_SYMBOL=__attribute__((visibility(\"default\")))", Loading system/gd/Android.bp +1 −53 Original line number Diff line number Diff line Loading @@ -12,9 +12,7 @@ cc_defaults { name: "gd_defaults", defaults: [ "bluetooth_cflags", ], tidy_checks: [ "-performance-unnecessary-value-param", "bluetooth_tidy", ], target: { android: { Loading @@ -39,56 +37,6 @@ cc_defaults { header_libs: ["jni_headers"], } cc_defaults { name: "gd_clang_tidy", tidy: true, tidy_checks: [ "-bugprone*", "-cert-dcl21-cpp", // warning: overloaded returns a non-constant object instead of a constant object type "-cert-dcl59-cpp", // warning: do not use unnamed namespaces in header files "-cert-msc30-c", // warning: rand() has limited randomness; use C++11 random library instead "-cert-msc50-cpp", // warning: rand() has limited randomness; use C++11 random library instead "-cert-oop54-cpp", // warning: operator=() does not handle self-assignment properly "-google*", "-performance*", "clang-analyzer-core.CallAndMessage", "clang-analyzer-optin.cplusplus.UninitializedObject", ], tidy_checks_as_errors: [ "clang-analyzer-core.CallAndMessage", "clang-analyzer-optin.cplusplus.UninitializedObject", "cppcoreguidelines-pro-type-member-init", ], tidy_flags: [ "--header-filter=^.*packages/modules/Bluetooth/system/.*.h$", "--extra-arg-before=-Xclang", "--extra-arg-before=-analyzer-config", "--extra-arg-before=-Xclang", "--extra-arg-before=optin.cplusplus.UninitializedObject:Pedantic=true", "--extra-arg-before=-Xclang", "--extra-arg-before=-analyzer-config", "--extra-arg-before=-Xclang", "--extra-arg-before=optin.cplusplus.UninitializedObject:CheckPointeeInitialization=true", ], } // Clang is targeted for android core libraries but other base libraries // may not support clang tidy recommendations (e.g. MacOS) cc_defaults { name: "gd_clang_tidy_ignore_android", tidy: true, tidy_checks: [ "-android-cloexec-accept", // warning: prefer accept4() to accept() because accept4() allows SOCK_CLOEXEC "-android-cloexec-pipe2", // warning: 'pipe2' should use O_CLOEXEC where possible "-android-cloexec-socket", // warning: 'pipe2' should use O_CLOEXEC where possible ], } soong_config_module_type { name: "mgmt_cc_defaults", module_type: "cc_defaults", Loading system/gd/dumpsys/Android.bp +0 −3 Original line number Diff line number Diff line Loading @@ -155,7 +155,6 @@ cc_library { name: "libbluetooth-dumpsys", host_supported: true, defaults: [ "gd_clang_tidy", "gd_defaults", ], generated_sources: [ Loading @@ -171,7 +170,6 @@ cc_library { name: "libbluetooth-dumpsys-test", host_supported: true, defaults: [ "gd_clang_tidy", "gd_defaults", ], generated_sources: [ Loading @@ -183,7 +181,6 @@ cc_library { name: "libbluetooth-dumpsys-unittest", host_supported: true, defaults: [ "gd_clang_tidy", "gd_defaults", ], generated_headers: [ Loading Loading
.clang-tidy 0 → 100644 +4 −0 Original line number Diff line number Diff line --- CheckOptions: - key: misc-include-cleaner.IgnoreHeaders value: (fmt/.*|bits/pthread_types\.h)
Android.bp +21 −0 Original line number Diff line number Diff line Loading @@ -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: { Loading
system/build/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ cc_defaults { name: "fluoride_defaults", defaults: [ "bluetooth_cflags", "bluetooth_tidy", ], cflags: [ "-DEXPORT_SYMBOL=__attribute__((visibility(\"default\")))", Loading
system/gd/Android.bp +1 −53 Original line number Diff line number Diff line Loading @@ -12,9 +12,7 @@ cc_defaults { name: "gd_defaults", defaults: [ "bluetooth_cflags", ], tidy_checks: [ "-performance-unnecessary-value-param", "bluetooth_tidy", ], target: { android: { Loading @@ -39,56 +37,6 @@ cc_defaults { header_libs: ["jni_headers"], } cc_defaults { name: "gd_clang_tidy", tidy: true, tidy_checks: [ "-bugprone*", "-cert-dcl21-cpp", // warning: overloaded returns a non-constant object instead of a constant object type "-cert-dcl59-cpp", // warning: do not use unnamed namespaces in header files "-cert-msc30-c", // warning: rand() has limited randomness; use C++11 random library instead "-cert-msc50-cpp", // warning: rand() has limited randomness; use C++11 random library instead "-cert-oop54-cpp", // warning: operator=() does not handle self-assignment properly "-google*", "-performance*", "clang-analyzer-core.CallAndMessage", "clang-analyzer-optin.cplusplus.UninitializedObject", ], tidy_checks_as_errors: [ "clang-analyzer-core.CallAndMessage", "clang-analyzer-optin.cplusplus.UninitializedObject", "cppcoreguidelines-pro-type-member-init", ], tidy_flags: [ "--header-filter=^.*packages/modules/Bluetooth/system/.*.h$", "--extra-arg-before=-Xclang", "--extra-arg-before=-analyzer-config", "--extra-arg-before=-Xclang", "--extra-arg-before=optin.cplusplus.UninitializedObject:Pedantic=true", "--extra-arg-before=-Xclang", "--extra-arg-before=-analyzer-config", "--extra-arg-before=-Xclang", "--extra-arg-before=optin.cplusplus.UninitializedObject:CheckPointeeInitialization=true", ], } // Clang is targeted for android core libraries but other base libraries // may not support clang tidy recommendations (e.g. MacOS) cc_defaults { name: "gd_clang_tidy_ignore_android", tidy: true, tidy_checks: [ "-android-cloexec-accept", // warning: prefer accept4() to accept() because accept4() allows SOCK_CLOEXEC "-android-cloexec-pipe2", // warning: 'pipe2' should use O_CLOEXEC where possible "-android-cloexec-socket", // warning: 'pipe2' should use O_CLOEXEC where possible ], } soong_config_module_type { name: "mgmt_cc_defaults", module_type: "cc_defaults", Loading
system/gd/dumpsys/Android.bp +0 −3 Original line number Diff line number Diff line Loading @@ -155,7 +155,6 @@ cc_library { name: "libbluetooth-dumpsys", host_supported: true, defaults: [ "gd_clang_tidy", "gd_defaults", ], generated_sources: [ Loading @@ -171,7 +170,6 @@ cc_library { name: "libbluetooth-dumpsys-test", host_supported: true, defaults: [ "gd_clang_tidy", "gd_defaults", ], generated_sources: [ Loading @@ -183,7 +181,6 @@ cc_library { name: "libbluetooth-dumpsys-unittest", host_supported: true, defaults: [ "gd_clang_tidy", "gd_defaults", ], generated_headers: [ Loading