Warning, /acts/cmake/ActsStaticAnalysis.cmake is written in an unsupported language. File is not indexed.
0001 if(ACTS_RUN_CLANG_TIDY)
0002 find_program(CLANG_TIDY_COMMAND NAMES clang-tidy)
0003 if(NOT CLANG_TIDY_COMMAND)
0004 message(
0005 WARNING
0006 "ACTS_RUN_CLANG_TIDY is ON but clang-tidy is not found!"
0007 )
0008 set(CMAKE_CXX_CLANG_TIDY "" CACHE STRING "" FORCE)
0009 else()
0010 message(STATUS "Setting up clang-tidy run")
0011
0012 set(_chks "")
0013 list(APPEND _chks "-*")
0014 list(APPEND _chks "clang-analyzer-optin.cplusplus.UninitializedObject")
0015 list(APPEND _chks "cppcoreguidelines-init-variables")
0016 list(APPEND _chks "cppcoreguidelines-pro-type-member-init")
0017 list(APPEND _chks "google-readability-casting")
0018 list(APPEND _chks "modernize-concat-nested-namespaces")
0019 list(APPEND _chks "modernize-use-equals-default")
0020 list(APPEND _chks "modernize-use-default-member-init")
0021 list(APPEND _chks "modernize-use-nullptr")
0022 list(APPEND _chks "modernize-use-override")
0023 list(APPEND _chks "modernize-use-using")
0024 list(APPEND _chks "performance-for-range-copy")
0025 list(APPEND _chks "performance-move-const-arg")
0026 list(APPEND _chks "performance-unnecessary-value-param")
0027 list(APPEND _chks "readability-braces-around-statements")
0028 list(APPEND _chks "readability-container-size-empty")
0029 list(APPEND _chks "readability-implicit-bool-cast")
0030 list(APPEND _chks "readability-implicit-bool-conversion")
0031 list(APPEND _chks "readability-inconsistent-declaration-parameter-name")
0032 list(APPEND _chks "readability-named-parameter")
0033 list(APPEND _chks "readability-operators-representation")
0034 list(JOIN _chks "," CLANG_TIDY_CHECKS)
0035
0036 message(STATUS "Configured checks")
0037 foreach(_chk ${_chks})
0038 message(STATUS "|-> ${_chk}")
0039 endforeach()
0040
0041 set(_errs "")
0042 list(JOIN _errs "," CLANG_TIDY_ERRORS)
0043
0044 message(STATUS "Enabled errors:")
0045 foreach(_err ${_errs})
0046 message(STATUS "|-> ${_err}")
0047 endforeach()
0048
0049 set(CLANG_TIDY_HEADER_FILTER ".*")
0050
0051 set(CMAKE_CXX_CLANG_TIDY
0052 "${CLANG_TIDY_COMMAND};-checks=${CLANG_TIDY_CHECKS};-header-filter=${CLANG_TIDY_HEADER_FILTER};-warnings-as-errors=${CLANG_TIDY_ERRORS}"
0053 )
0054 endif()
0055 endif()