[core] Add .clang-tidy (#755)

This commit is contained in:
LoveSy 2021-06-20 15:44:15 +08:00 committed by GitHub
parent 1763d82c2d
commit 81158eaa0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 70 additions and 6 deletions

View File

@ -0,0 +1,64 @@
---
Checks: >
-*,
bugprone-*,
google-*,
misc-*,
modernize-*,
performance-*,
portability-*,
readability-*,
clang-analyzer-*,
llvm-include-order,
-modernize-use-trailing-return-type,
# Turn all the warnings from the checks above into errors.
WarningsAsErrors: "*"
CheckOptions:
- key: readability-identifier-naming.ClassCase
value: CamelCase
- key: readability-identifier-naming.ClassMemberCase
value: lower_case
- key: readability-identifier-naming.EnumCase
value: CamelCase
- key: readability-identifier-naming.EnumConstantCase
value: CamelCase
- key: readability-identifier-naming.EnumConstantPrefix
value: k
- key: readability-identifier-naming.FunctionCase
value: CamelCase
- key: readability-identifier-naming.GlobalConstantCase
value: CamelCase
- key: readability-identifier-naming.GlobalConstantPrefix
value: k
- key: readability-identifier-naming.StaticConstantCase
value: CamelCase
- key: readability-identifier-naming.StaticConstantPrefix
value: k
- key: readability-identifier-naming.StaticVariableCase
value: CamelCase
- key: readability-identifier-naming.StaticVariablePrefix
value: k
- key: readability-identifier-naming.MacroDefinitionCase
value: UPPER_CASE
- key: readability-identifier-naming.MemberCase
value: lower_case
- key: readability-identifier-naming.MemberSuffix
value: _
- key: readability-identifier-naming.NamespaceCase
value: lower_case
- key: readability-identifier-naming.ParameterCase
value: lower_case
- key: readability-identifier-naming.TypeAliasCase
value: CamelCase
- key: readability-identifier-naming.TypedefCase
value: CamelCase
- key: readability-identifier-naming.VariableCase
value: lower_case
- key: readability-identifier-naming.IgnoreMainLikeFunctions
value: 1
- key: readability-implicit-bool-conversion.AllowIntegerConditions
value: 1
- key: readability-implicit-bool-conversion.AllowPointerConditions
value: 1

@ -1 +1 @@
Subproject commit 9141e5aed87360fa6926ad05a8ac1511fc6bcbe6
Subproject commit 236b1b03b4c6f9465faba94a0bae7ed8c99c6e67

View File

@ -28,8 +28,8 @@ namespace art {
class GCCriticalSection {
private:
void* self_;
const char* section_name_;
[[maybe_unused]] void* self_;
[[maybe_unused]] const char* section_name_;
};
class ScopedGCCriticalSection {
@ -56,8 +56,8 @@ namespace art {
RETRIEVE_MEM_FUNC_SYMBOL(destructor, "_ZN3art2gc23ScopedGCCriticalSectionD2Ev");
}
private:
GCCriticalSection critical_section_;
const char* old_no_suspend_reason_;
[[maybe_unused]] GCCriticalSection critical_section_;
[[maybe_unused]] const char* old_no_suspend_reason_;
};
}
}

View File

@ -115,7 +115,7 @@ namespace art {
}
);
static void DisableHiddenApi(const SandHook::ElfImg &handle) {
static void DisableHiddenApi([[maybe_unused]] const SandHook::ElfImg &handle) {
const int api_level = lspd::GetAndroidApiLevel();
if (api_level < __ANDROID_API_P__) {