From 979e0aaa9a554b56e25dd87998d803a7ebdc8d42 Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Mon, 11 Apr 2022 16:57:57 +0800 Subject: [PATCH] Makefile // Changing rules used for clang-format. --- Makefile | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 4717b8e9..48a5c361 100644 --- a/Makefile +++ b/Makefile @@ -25,22 +25,14 @@ VC_APP_ROOT = $(DSTROOT)/vChewing.app format: batchfix clang-format lint clang-format: - @swift-format format --in-place --configuration ./.clang-format-swift.json --recursive ./DataCompiler/ - @swift-format format --in-place --configuration ./.clang-format-swift.json --recursive ./Installer/ - @swift-format format --in-place --configuration ./.clang-format-swift.json --recursive ./Source/ - @swift-format format --in-place --configuration ./.clang-format-swift.json --recursive ./UserPhraseEditor/ - @find ./Installer/ -iname '*.h' -o -iname '*.m' | xargs clang-format -i -style=Microsoft - @find ./Source/3rdParty/OVMandarin -iname '*.h' -o -iname '*.cpp' -o -iname '*.mm' -o -iname '*.m' | xargs clang-format -i -style=Microsoft - @find ./Source/Modules/ -iname '*.h' -o -iname '*.cpp' -o -iname '*.mm' -o -iname '*.m' | xargs clang-format -i -style=Microsoft + @git ls-files --exclude-standard | grep -E '\.swift$$' | xargs swift-format format --in-place --configuration ./.clang-format-swift.json --parallel + @git ls-files --exclude-standard | grep -E '\.(cpp|hpp|c|cc|cxx|hxx|ixx|h|m|mm|hh)$$' | xargs clang-format -i -style=Microsoft lint: - @swift-format lint --configuration ./.clang-format-swift.json --recursive --parallel ./DataCompiler/ - @swift-format lint --configuration ./.clang-format-swift.json --recursive --parallel ./Installer/ - @swift-format lint --configuration ./.clang-format-swift.json --recursive --parallel ./Source/ - @swift-format lint --configuration ./.clang-format-swift.json --recursive --parallel ./UserPhraseEditor/ + @git ls-files --exclude-standard | grep -E '\.swift$$' | xargs swift-format lint --configuration ./.clang-format-swift.json --parallel batchfix: - @swiftlint --fix ./ + @git ls-files --exclude-standard | grep -E '\.swift$$' | swiftlint --fix --autocorrect .PHONY: permission-check install-debug install-release