diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 00000000..664df431 --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,13 @@ +--- +Checks: '-*,readability-identifier-naming' +CheckOptions: + - { key: readability-identifier-naming.NamespaceCase, value: lower_case } + - { key: readability-identifier-naming.ClassCase, value: CamelCase } + - { key: readability-identifier-naming.PrivateMemberPrefix, value: _ } + - { key: readability-identifier-naming.StructCase, value: CamelCase } + - { key: readability-identifier-naming.FunctionCase, value: lower_case } + - { key: readability-identifier-naming.VariableCase, value: lower_case } + - { key: readability-identifier-naming.GlobalConstantCase, value: UPPER_CASE } +WarningsAsErrors: '-*' +HeaderFilterRegex: '*.h' +FormatStyle: llvm \ No newline at end of file diff --git a/cmake/StaticAnalyzers.cmake b/cmake/StaticAnalyzers.cmake new file mode 100644 index 00000000..143f3533 --- /dev/null +++ b/cmake/StaticAnalyzers.cmake @@ -0,0 +1,20 @@ +if( ENABLE_CLANG_TIDY ) + find_program( CLANGTIDY clang-tidy ) + if( CLANGTIDY ) + set( CMAKE_CXX_CLANG_TIDY ${CLANGTIDY} -extra-arg=-Wno-unknown-warning-option ) + message( "Clang-Tidy finished setting up." ) + else() + message( SEND_ERROR "Clang-Tidy requested but executable not found." ) + endif() +endif() + +if( ENABLE_CPPCHECK ) + find_program( CPPCHECK cppcheck ) + if( CPPCHECK ) + set( CMAKE_CXX_CPPCHECK ${CPPCHECK} --suppress=missingInclude --enable=all + --inline-suppr --inconclusive -i ${CMAKE_SOURCE_DIR}/imgui/lib ) + message( "Cppcheck finished setting up." ) + else() + message( SEND_ERROR "Cppcheck requested but executable not found." ) + endif() +endif() \ No newline at end of file