From 363a01f6923246624e52d24a46bba9798cf27772 Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Mon, 11 Apr 2022 08:20:21 +0800 Subject: [PATCH] Makefile // Use SwiftLint to optimize swift codebase. --- Makefile | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 57943fb0..4717b8e9 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,9 @@ debug: DSTROOT = /Library/Input Methods VC_APP_ROOT = $(DSTROOT)/vChewing.app -.PHONY: clang-format lint +.PHONY: clang-format lint batchfix format + +format: batchfix clang-format lint clang-format: @swift-format format --in-place --configuration ./.clang-format-swift.json --recursive ./DataCompiler/ @@ -30,11 +32,15 @@ clang-format: @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 + lint: - @swift-format lint --configuration ./.clang-format-swift.json --recursive ./DataCompiler/ - @swift-format lint --configuration ./.clang-format-swift.json --recursive ./Installer/ - @swift-format lint --configuration ./.clang-format-swift.json --recursive ./Source/ - @swift-format lint --configuration ./.clang-format-swift.json --recursive ./UserPhraseEditor/ + @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/ + +batchfix: + @swiftlint --fix ./ .PHONY: permission-check install-debug install-release