From ba42645d95c093561b8a7eeecd7e6034526fdd61 Mon Sep 17 00:00:00 2001 From: jongpyo Ahn <68585628+JongPyoAhn@users.noreply.github.com> Date: Sat, 18 Nov 2023 15:50:23 +0900 Subject: [PATCH] =?UTF-8?q?[GWL-53]=20SwiftLint=20=EC=88=98=EC=A0=95=20(#6?= =?UTF-8?q?1)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * build: swiftLint 수정 Trailing Comma, line_length 수정 * fix: SwiftLint 적용이 안되는 현상 개선 기존에 적용이 안되는 이유는 Scripts에 적혀있던데로 generate할 때 경로지정을 안해줬기 때문입니다. * build: SwiftFormat sortedSwitchCases -> sortSwitchCase --- iOS/.swiftformat | 2 +- iOS/.swiftlint.yml | 8 ++++++++ iOS/Makefile | 19 +++++++++++++++++++ .../Scripts+Templates.swift | 2 +- 4 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 iOS/Makefile diff --git a/iOS/.swiftformat b/iOS/.swiftformat index 40546cb5..fa2c2007 100644 --- a/iOS/.swiftformat +++ b/iOS/.swiftformat @@ -13,7 +13,7 @@ --enable docComments --enable isEmpty --enable markTypes ---enable sortedSwitchCases +--enable sortSwitchCases --enable wrapEnumCases --enable wrapSwitchCases --guardelse "next-line" diff --git a/iOS/.swiftlint.yml b/iOS/.swiftlint.yml index 0f816928..3330e514 100644 --- a/iOS/.swiftlint.yml +++ b/iOS/.swiftlint.yml @@ -14,6 +14,8 @@ only_rules: - void_return - unowned_variable_capture - custom_rules + - trailing_comma + - line_length excluded: - Carthage @@ -25,6 +27,12 @@ colon: indentation: 2 +trailing_comma: + mandatory_comma: true + +line_length: + warning: 150 + custom_rules: no_objcMembers: name: "@objcMembers" diff --git a/iOS/Makefile b/iOS/Makefile new file mode 100644 index 00000000..71dac86b --- /dev/null +++ b/iOS/Makefile @@ -0,0 +1,19 @@ +generate: + tuist fetch + TUIST_ROOT_DIR=${PWD} tuist generate + +test: + tuist clean + tuist fetch + TUIST_ROOT_DIR=${PWD} tuist test +build: + TUIST_ROOT_DIR=${PWD} tuist build + +clean: + rm -rf **/*.xcodeproj + rm -rf *.xcworkspace + +reset: + tuist clean + rm -rf **/*.xcodeproj + rm -rf *.xcworkspace diff --git a/iOS/Tuist/ProjectDescriptionHelpers/Scripts+Templates.swift b/iOS/Tuist/ProjectDescriptionHelpers/Scripts+Templates.swift index 2f4036cd..beacb3e9 100644 --- a/iOS/Tuist/ProjectDescriptionHelpers/Scripts+Templates.swift +++ b/iOS/Tuist/ProjectDescriptionHelpers/Scripts+Templates.swift @@ -12,7 +12,7 @@ private let tuistRootDirectory = ProcessInfo.processInfo.environment["TUIST_ROOT private func swiftFormatCommand() -> String { if let tuistRootDirectory { - return "swiftformat --config \(tuistRootDirectory)/swiftformat ." + return "swiftformat . --config \(tuistRootDirectory)/.swiftformat" } else { return "swiftformat ." }