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:
Marko Budiselic 2016-12-02 13:48:14 +01:00
parent 0c65a9e97e
commit aedcb1c244
2 changed files with 31 additions and 4 deletions

8
.arclint Normal file
View File

@ -0,0 +1,8 @@
{
"linters": {
"cppcheck": {
"type": "cppcheck",
"include": ["(\\.cpp$)", "(\\.hpp$)"]
}
}
}

View File

@ -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")