Форматирование кода
This commit is contained in:
parent
8ca93d3115
commit
197e5b3939
@ -1,9 +1,4 @@
|
||||
find_program(
|
||||
CLANG_CHECK_EXE
|
||||
NAMES
|
||||
clang-check-10
|
||||
clang-check-9
|
||||
clang-check)
|
||||
find_program(CLANG_CHECK_EXE NAMES clang-check-10 clang-check-9 clang-check)
|
||||
if(CLANG_CHECK_EXE)
|
||||
option(CMLIB_CLANG_ANALYZE_FIX "Perform fixes for Clang-Check" OFF)
|
||||
endif()
|
||||
|
@ -1,9 +1,4 @@
|
||||
find_program(
|
||||
CLANG_TIDY_EXE
|
||||
NAMES
|
||||
clang-tidy-10
|
||||
clang-tidy-9
|
||||
clang-tidy)
|
||||
find_program(CLANG_TIDY_EXE NAMES clang-tidy-10 clang-tidy-9 clang-tidy)
|
||||
if(CLANG_TIDY_EXE)
|
||||
option(CMLIB_CLANG_TIDY_FIX "Perform fixes for Clang-Tidy" OFF)
|
||||
endif()
|
||||
|
@ -1,9 +1,5 @@
|
||||
find_program(
|
||||
CLANG_APPLY_REPLACEMENTS_EXE
|
||||
NAMES
|
||||
clang-apply-replacements-10
|
||||
clang-apply-replacements-9
|
||||
clang-apply-replacements)
|
||||
find_program(CLANG_APPLY_REPLACEMENTS_EXE NAMES clang-apply-replacements-10 clang-apply-replacements-9
|
||||
clang-apply-replacements)
|
||||
|
||||
find_program(CLAZY_EXE NAMES clazy-standalone)
|
||||
|
||||
@ -20,21 +16,26 @@ function(add_clazy_check target)
|
||||
|
||||
set(_sources ${_CLAZY_UNPARSED_ARGUMENTS})
|
||||
if(NOT _CLAZY_CHECKS)
|
||||
set(_CLAZY_CHECKS "level2,container-inside-loop,heap-allocated-small-trivial-type,inefficient-qlist,isempty-vs-count,qt-keywords,unneeded-cast")
|
||||
set(_CLAZY_CHECKS
|
||||
"level2,container-inside-loop,heap-allocated-small-trivial-type,inefficient-qlist,isempty-vs-count,qt-keywords,unneeded-cast"
|
||||
)
|
||||
endif()
|
||||
set(_args -checks=${_CLAZY_CHECKS} -extra-arg="-Wno-unknown-warning-option" -export-fixes=clazy-fixes-file.yaml)
|
||||
set(_args -checks=${_CLAZY_CHECKS} -extra-arg="-Wno-unknown-warning-option"
|
||||
-export-fixes=clazy-fixes-file.yaml)
|
||||
|
||||
if(CLAZY_EXE)
|
||||
if(NOT TARGET clazy-check)
|
||||
add_custom_target(clazy-check)
|
||||
endif()
|
||||
if(CMLIB_CLAZY_FIX)
|
||||
add_custom_target(clazy-check-${target} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
COMMAND ${CLAZY_EXE} ${_args} -p ${CMAKE_BINARY_DIR} ${_sources}
|
||||
COMMAND ${CLANG_APPLY_REPLACEMENTS_EXE} ${CMAKE_BINARY_DIR})
|
||||
add_custom_target(
|
||||
clazy-check-${target}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
COMMAND ${CLAZY_EXE} ${_args} -p ${CMAKE_BINARY_DIR} ${_sources}
|
||||
COMMAND ${CLANG_APPLY_REPLACEMENTS_EXE} ${CMAKE_BINARY_DIR})
|
||||
else()
|
||||
add_custom_target(clazy-check-${target} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
COMMAND ${CLAZY_EXE} ${_args} -p ${CMAKE_BINARY_DIR} ${_sources})
|
||||
COMMAND ${CLAZY_EXE} ${_args} -p ${CMAKE_BINARY_DIR} ${_sources})
|
||||
endif()
|
||||
add_dependencies(clazy-check-${target} ${target})
|
||||
add_dependencies(clazy-check clazy-check-${target})
|
||||
|
Loading…
Reference in New Issue
Block a user