ku-ring / ios-app

쿠링 iOS 앱 v2 레포입니다. SwiftUI + TCA

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[2.0.0] SwiftFormat 적용

x-0o0 opened this issue · comments

개요

오픈소스 라이센스에 대한 내용을 모든 소스파일에 명시해야합니다.

SwiftFormat 적용

SwiftFormat의 헤더 포맷 사용

https://github.com/nicklockwood/SwiftFormat#file-headers

// .swiftformat
--header "\nCopyright (c) {year} 쿠링\nSee the 'License.txt' file for licensing information.\n"

--self init-only 
--semicolons never 
--extensionacl on-declarations
--importgrouping length

--xcodeindentation enabled # 의도대로 동작되지 않는 것 같음

--guardelse same-line
--stripunusedargs closure-only
--emptybraces spaced
--wrapternary before-operators

--disable redundantRawValues
--disable redundantFileprivate
--disable redundantClosure

디자인

스크린샷이나 다이어그램

기대효과

SwiftFormat 을 사용하면 쉽게 빌드타임에 일괄 적용할 수 있습니다.

대안 (선택사항)

SwiftLint, xctemplate

https://github.com/nicklockwood/SwiftFormat#file-headers

다음과 같이 .swiftformat 파일을 설정했을 때 기본으로 enable 되어 있는 규칙들이 적용되는 문제가 있음

--header "\nCopyright (c) {year} 쿠링\nSee the 'License.txt' file for licensing information.\n"

--xcodeindentation enabled 를 추가했음에도 불구하고 ternary conditional operators 에서 자꾸 indent 가 적용되는 현상이 있음.

SwiftFormat 에 이슈 등록: nicklockwood/SwiftFormat#1616