diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 0000000..152e03a --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,35 @@ +Checks: '-*,clang-diagnostic-*,clang-analyzer-*,cppcoreguidelines-*,portability-*,readability-*,performance-*' +WarningsAsErrors: '' +HeaderFilterRegex: '' +AnalyzeTemporaryDtors: false +FormatStyle: none +User: Xaymar +CheckOptions: + - key: cert-dcl16-c.NewSuffixes + value: 'L;LL;LU;LLU' + - key: cert-oop54-cpp.WarnOnlyIfThisHasSuspiciousField + value: '0' + - key: cppcoreguidelines-explicit-virtual-functions.IgnoreDestructors + value: '1' + - key: cppcoreguidelines-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic + value: '1' + - key: google-readability-braces-around-statements.ShortStatementLines + value: '1' + - key: google-readability-function-size.StatementThreshold + value: '800' + - key: google-readability-namespace-comments.ShortNamespaceLines + value: '10' + - key: google-readability-namespace-comments.SpacesBeforeComments + value: '2' + - key: modernize-loop-convert.MaxCopySize + value: '16' + - key: modernize-loop-convert.MinConfidence + value: reasonable + - key: modernize-loop-convert.NamingStyle + value: CamelCase + - key: modernize-pass-by-value.IncludeStyle + value: llvm + - key: modernize-replace-auto-ptr.IncludeStyle + value: llvm + - key: modernize-use-nullptr.NullMacros + value: 'NULL' diff --git a/CMakeLists.txt b/CMakeLists.txt index 7fa41aa..19caca7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -909,6 +909,7 @@ set_target_properties( ${PROJECT_NAME} PROPERTIES CXX_STANDARD ${_CXX_STANDARD} + CXX_STANDARD_REQUIRED ON CXX_EXTENSIONS ${_CXX_EXTENSIONS} ) @@ -947,8 +948,15 @@ if(HAVE_OBS_FRONTEND) ) endif() -# Clang-Format +# Clang Tools if(HAVE_CLANG) + generate_compile_commands_json( + TARGETS ${PROJECT_NAME} + ) + clang_tidy( + TARGETS ${PROJECT_NAME} + VERSION 9.0.0 + ) clang_format( TARGETS ${PROJECT_NAME} DEPENDENCY diff --git a/cmake/clang b/cmake/clang index 9166c8a..58da85a 160000 --- a/cmake/clang +++ b/cmake/clang @@ -1 +1 @@ -Subproject commit 9166c8a575a2a6bf4c029cfefc84d4bbe62befc5 +Subproject commit 58da85a255b468ad170603e9528d63cf0d73bd27