Skip to content

Commit

Permalink
Add clang-tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
kennethassogba committed Nov 12, 2024
1 parent ac8318c commit be72110
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ include(CMakePrintHelpers)
cmake_print_variables(PROJECT_SOURCE_DIR CMAKE_BUILD_TYPE)
cmake_print_variables(CMAKE_CXX_COMPILER CMAKE_CXX_COMPILER_ID CMAKE_CXX_COMPILER_VERSION)
cmake_print_variables(CMAKE_CXX_FLAGS COMPILE_DEFINITIONS)
cmake_print_variables(LINK_LIBS)
cmake_print_variables(CMAKE_CXX_COMPILER_RANLIB)
cmake_print_variables(OpenMP_CXX_FOUND OpenMP_CXX_FLAGS OpenMP_CXX_INCLUDE_DIRS)
cmake_print_variables(OpenMP::OpenMP_CXX OpenMP_CXX_VERSION)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Numerically, the physics part is coded in C++ with Python as a user interface fo
- [x] Add AddressSanitizer, ThreadSanitizer, MemorySanitizer.
- [x] Setup Github Action.
- [x] Improve Github Action, by fixing OpenMP not found and with recent version of compiler and Eigen.
- [ ] Choose a code style (Google style eg) and setup a linter.
- [x] Choose a code style (Google style eg) and setup a linter.
- [ ] Setup directory structure.
- [ ] Write a first real but simple code.
- [ ] Talk about doc style (eg doc string) and the way to generate it automatically.
Expand Down
26 changes: 13 additions & 13 deletions cmake/clang-cxx-dev-tools.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ if(CLANG_FORMAT)
endif()

# Adding clang-tidy target if executable is found
# find_program(CLANG_TIDY "clang-tidy")
# if(CLANG_TIDY)
# add_custom_target(
# clang-tidy
# COMMAND /usr/bin/clang-tidy
# ${ALL_CXX_SOURCE_FILES}
# -config=''
# --
# -std=c++20
# ${INCLUDE_DIRECTORIES}
# ${LIBS_DIR}
# )
# endif()
find_program(CLANG_TIDY "clang-tidy")
if(CLANG_TIDY)
add_custom_target(
clang-tidy
COMMAND /usr/bin/clang-tidy
${ALL_CXX_SOURCE_FILES}
-config=''
--
-std=c++20
${INCLUDE_DIRECTORIES}
-I /usr/include/eigen3/ # TODO find a general way to include
)
endif()

0 comments on commit be72110

Please sign in to comment.