From 8ce7e7409f10f0a90ed8aa3f6f179c4b5d44eacb Mon Sep 17 00:00:00 2001 From: dundargoc <33953936+dundargoc@users.noreply.github.com> Date: Tue, 2 Aug 2022 12:32:57 +0200 Subject: build: add formatting targets for c and lua files (#19488) The targets will only format files that have been changed in current branch compared to the master branch. This includes unstaged, staged and committed files. Add following make and cmake targets: formatc - format changed c files formatlua - format changed lua files format - run formatc and formatlua Remove scripts/uncrustify.sh as this deprecates it. --- src/nvim/CMakeLists.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt index f302f25ad6..017883a913 100755 --- a/src/nvim/CMakeLists.txt +++ b/src/nvim/CMakeLists.txt @@ -778,9 +778,16 @@ add_glob_targets( FLAGS -c "${PROJECT_SOURCE_DIR}/src/uncrustify.cfg" -q --check FILES ${LINT_NVIM_SOURCES} ) - add_dependencies(lintuncrustify uncrustify-version) +add_custom_target(formatc + COMMAND ${CMAKE_COMMAND} + -D FORMAT_PRG=${UNCRUSTIFY_PRG} + -D LANG=c + -P ${PROJECT_SOURCE_DIR}/cmake/Format.cmake + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}) +add_dependencies(formatc uncrustify-version) + add_custom_target( lintcfull COMMAND -- cgit