Linter setup. Fixes T154
Summary: Linter setup. Fixes T154 Test Plan: manual Reviewers: sale Subscribers: buda, sale Maniphest Tasks: T154 Differential Revision: https://memgraph.phacility.com/D13
This commit is contained in:
parent
0c65a9e97e
commit
aedcb1c244
8
.arclint
Normal file
8
.arclint
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"linters": {
|
||||
"cppcheck": {
|
||||
"type": "cppcheck",
|
||||
"include": ["(\\.cpp$)", "(\\.hpp$)"]
|
||||
}
|
||||
}
|
||||
}
|
@ -137,10 +137,29 @@ endforeach()
|
||||
|
||||
include(copy_includes)
|
||||
|
||||
# add all cpp file recursive into sourceFiles varibale
|
||||
# FILE(GLOB_RECURSE sourceFiles ${src_dir}/*.cpp)
|
||||
# print list of source files
|
||||
# MESSAGE(STATUS "All source files are: ${sourceFiles}")
|
||||
# linter setup (clang-tidy)
|
||||
# all source files for linting
|
||||
FILE(GLOB_RECURSE LINTER_SRC_FILES
|
||||
${src_dir}/*.cpp
|
||||
${CMAKE_SOURCE_DIR}/tests/.cpp
|
||||
${CMAKE_SOURCE_DIR}/poc/.cpp
|
||||
)
|
||||
MESSAGE(STATUS "All cpp files for linting are: ${LINTER_SRC_FILES}")
|
||||
|
||||
# linter target clang-tidy
|
||||
find_program(CLANG_TIDY "clang-tidy")
|
||||
if(CLANG_TIDY)
|
||||
add_custom_target(
|
||||
clang-tidy
|
||||
COMMAND /usr/bin/clang-tidy
|
||||
${LINTER_SRC_FILES}
|
||||
-config=''
|
||||
--
|
||||
-std=c++1y
|
||||
-I${CMAKE_SOURCE_DIR}/include -I${fmt_source_dir}
|
||||
)
|
||||
endif()
|
||||
# linter setup
|
||||
|
||||
# debug flags
|
||||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
|
Loading…
Reference in New Issue
Block a user