Форматирование кода
This commit is contained in:
parent
8ca93d3115
commit
197e5b3939
@ -1,9 +1,4 @@
|
|||||||
find_program(
|
find_program(CLANG_CHECK_EXE NAMES clang-check-10 clang-check-9 clang-check)
|
||||||
CLANG_CHECK_EXE
|
|
||||||
NAMES
|
|
||||||
clang-check-10
|
|
||||||
clang-check-9
|
|
||||||
clang-check)
|
|
||||||
if(CLANG_CHECK_EXE)
|
if(CLANG_CHECK_EXE)
|
||||||
option(CMLIB_CLANG_ANALYZE_FIX "Perform fixes for Clang-Check" OFF)
|
option(CMLIB_CLANG_ANALYZE_FIX "Perform fixes for Clang-Check" OFF)
|
||||||
endif()
|
endif()
|
||||||
|
@ -1,9 +1,4 @@
|
|||||||
find_program(
|
find_program(CLANG_TIDY_EXE NAMES clang-tidy-10 clang-tidy-9 clang-tidy)
|
||||||
CLANG_TIDY_EXE
|
|
||||||
NAMES
|
|
||||||
clang-tidy-10
|
|
||||||
clang-tidy-9
|
|
||||||
clang-tidy)
|
|
||||||
if(CLANG_TIDY_EXE)
|
if(CLANG_TIDY_EXE)
|
||||||
option(CMLIB_CLANG_TIDY_FIX "Perform fixes for Clang-Tidy" OFF)
|
option(CMLIB_CLANG_TIDY_FIX "Perform fixes for Clang-Tidy" OFF)
|
||||||
endif()
|
endif()
|
||||||
|
@ -1,9 +1,5 @@
|
|||||||
find_program(
|
find_program(CLANG_APPLY_REPLACEMENTS_EXE NAMES clang-apply-replacements-10 clang-apply-replacements-9
|
||||||
CLANG_APPLY_REPLACEMENTS_EXE
|
clang-apply-replacements)
|
||||||
NAMES
|
|
||||||
clang-apply-replacements-10
|
|
||||||
clang-apply-replacements-9
|
|
||||||
clang-apply-replacements)
|
|
||||||
|
|
||||||
find_program(CLAZY_EXE NAMES clazy-standalone)
|
find_program(CLAZY_EXE NAMES clazy-standalone)
|
||||||
|
|
||||||
@ -20,21 +16,26 @@ function(add_clazy_check target)
|
|||||||
|
|
||||||
set(_sources ${_CLAZY_UNPARSED_ARGUMENTS})
|
set(_sources ${_CLAZY_UNPARSED_ARGUMENTS})
|
||||||
if(NOT _CLAZY_CHECKS)
|
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()
|
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(CLAZY_EXE)
|
||||||
if(NOT TARGET clazy-check)
|
if(NOT TARGET clazy-check)
|
||||||
add_custom_target(clazy-check)
|
add_custom_target(clazy-check)
|
||||||
endif()
|
endif()
|
||||||
if(CMLIB_CLAZY_FIX)
|
if(CMLIB_CLAZY_FIX)
|
||||||
add_custom_target(clazy-check-${target} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
add_custom_target(
|
||||||
COMMAND ${CLAZY_EXE} ${_args} -p ${CMAKE_BINARY_DIR} ${_sources}
|
clazy-check-${target}
|
||||||
COMMAND ${CLANG_APPLY_REPLACEMENTS_EXE} ${CMAKE_BINARY_DIR})
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
COMMAND ${CLAZY_EXE} ${_args} -p ${CMAKE_BINARY_DIR} ${_sources}
|
||||||
|
COMMAND ${CLANG_APPLY_REPLACEMENTS_EXE} ${CMAKE_BINARY_DIR})
|
||||||
else()
|
else()
|
||||||
add_custom_target(clazy-check-${target} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
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()
|
endif()
|
||||||
add_dependencies(clazy-check-${target} ${target})
|
add_dependencies(clazy-check-${target} ${target})
|
||||||
add_dependencies(clazy-check clazy-check-${target})
|
add_dependencies(clazy-check clazy-check-${target})
|
||||||
|
Loading…
Reference in New Issue
Block a user