-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path.swiftformat
More file actions
110 lines (87 loc) · 2.49 KB
/
.swiftformat
File metadata and controls
110 lines (87 loc) · 2.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# SwiftFormat configuration
# https://github.com/nicklockwood/SwiftFormat
# Swift version
--swiftversion 6.2
# ============================
# Formatting Options
# ============================
# Indentation
--indent 4
--tabwidth 4
--smarttabs enabled
# Line length
--maxwidth 120
# Braces style (K&R, not Allman)
--allman false
# Else/catch on same line
--elseposition same-line
--guardelse next-line
# Semicolons
--semicolons never
# Trailing commas (항상 제거)
--commas never
# Void
--voidtype void
# Imports 정렬 (testable은 하단, 빈 줄로 구분)
--importgrouping testable-bottom
# Access control
--extensionacl on-declarations
# Argument wrapping
--wraparguments before-first
--wrapparameters before-first
--wrapcollections before-first
--wrapreturntype if-multiline
--closingparen balanced
--wraptypealiases preserve
# Attribute wrapping
--funcattributes prev-line
--typeattributes prev-line
--varattributes prev-line
--storedvarattributes prev-line
--computedvarattributes prev-line
--complexattributes prev-line
# Modifier order (Swift API Design Guidelines 기준)
--modifierorder override,acl,setterACL,dynamic,mutating,lazy,final,required,convenience,typeMethods,owned
# Header comment 제거
--header strip
# Extension MARK 자동 삽입
--markextensions always
# Numeric literals (가독성을 위한 그룹화)
--decimalgrouping 3,6
--binarygrouping 4,8
--octalgrouping 4,8
--hexgrouping 2,8
--fractiongrouping enabled
--exponentgrouping enabled
--hexliteralcase uppercase
--exponentcase lowercase
# ============================
# Enable Opt-in Rules
# ============================
--enable acronyms
--enable blankLineAfterSwitchCase
--enable blankLinesAfterGuardStatements
--enable blockComments
--enable docComments
--enable enumNamespaces
--enable genericExtensions
--enable isEmpty
--enable preferForLoop
--enable wrapConditionalBodies
--enable wrapEnumCases
# ============================
# Disable Rules
# ============================
# fileHeader는 --header strip으로 제어
--disable fileHeader
# markTypes 자동 삽입 비활성화 (markExtensions만 사용)
--disable markTypes
# 임포트 그룹 사이 빈 줄 허용
--disable blankLinesBetweenImports
# @Test("한국어 설명") + 영문 함수명 → 백틱 한글 함수명 변환 방지
--disable swiftTestingTestCaseNames
# ============================
# Exclude
# ============================
# Tuist 매니페스트 파일 제외 (Tuist API는 bundleId 등 고유 네이밍을 사용)
--exclude Tuist,**/Project.swift,Workspace.swift