Skip to content

Commit

Permalink
One more clang-tidy variation
Browse files Browse the repository at this point in the history
  • Loading branch information
a4z committed May 3, 2024
1 parent c898215 commit 1cd1414
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ CheckOptions:
- key: readability-identifier-naming.FunctionCase
value: lower_case

WarningsAsErrors: ''
HeaderFilterRegex: 'src/|include/|tests/'
WarningsAsErrors: '*'
# HeaderFilterRegex: ''
FormatStyle: 'file'
5 changes: 1 addition & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,12 @@ if(PROJECT_IS_TOP_LEVEL)

add_custom_target(
clang-tidy
# COMMAND git ls-files | grep -E ".*\\.(c|h|cpp|hpp)$" | xargs clang-tidy -p=${CMAKE_CURRENT_BINARY_DIR} --extra-arg=-std=c++${CMAKE_CXX_STANDARD}
COMMAND find ${CMAKE_SOURCE_DIR}/include -name *.hpp -exec clang-tidy --extra-arg=-std=c++${CMAKE_CXX_STANDARD} -p ${CMAKE_BINARY_DIR} {} \;
# COMMAND find ${CMAKE_SOURCE_DIR}/tests -name '*.cpp' -exec clang-tidy -p ${CMAKE_BINARY_DIR} {}
COMMAND git ls-files | grep -E "^(include|src)/.*\.(c|cpp|h|hpp)$" | xargs clang-tidy --extra-arg=-std=c++${CMAKE_CXX_STANDARD} -p ${CMAKE_BINARY_DIR} --header-filter='^$'
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
VERBATIM
USES_TERMINAL
)


add_custom_target(
clang-format
COMMAND git ls-files | grep -E ".*\\.(c|h|cpp|hpp)$" | xargs clang-format -i
Expand Down

0 comments on commit 1cd1414

Please sign in to comment.