Skip to content

Commit caefc57

Browse files
committed
chore :: SwiftLint 커스텀 룰 적용
1 parent 033ad5f commit caefc57

File tree

5 files changed

+175
-0
lines changed

5 files changed

+175
-0
lines changed

PhotoGether/DataUtility/DataUtility.xcodeproj/project.pbxproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
objectVersion = 77;
77
objects = {
88

9+
/* Begin PBXBuildFile section */
10+
7B0318C22CDBA9A10026C613 /* Temp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60F77C222CDBA01C002630F0 /* Temp.swift */; };
11+
/* End PBXBuildFile section */
12+
913
/* Begin PBXFileReference section */
1014
60F77C092CDB9F8A002630F0 /* DataUtility.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = DataUtility.framework; sourceTree = BUILT_PRODUCTS_DIR; };
1115
60F77C222CDBA01C002630F0 /* Temp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Temp.swift; sourceTree = "<group>"; };
@@ -128,6 +132,7 @@
128132
isa = PBXSourcesBuildPhase;
129133
buildActionMask = 2147483647;
130134
files = (
135+
7B0318C22CDBA9A10026C613 /* Temp.swift in Sources */,
131136
);
132137
runOnlyForDeploymentPostprocessing = 0;
133138
};

PhotoGether/PhotoGether.xcodeproj/project.pbxproj

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@
9696
buildConfigurationList = 60CB81ED2CDA442900873DD6 /* Build configuration list for PBXNativeTarget "PhotoGether" */;
9797
buildPhases = (
9898
60CB81D62CDA442700873DD6 /* Sources */,
99+
7B0318C02CDBA6FF0026C613 /* SwiftLint */,
99100
60CB81D72CDA442700873DD6 /* Frameworks */,
100101
60CB81D82CDA442700873DD6 /* Resources */,
101102
);
@@ -134,6 +135,9 @@
134135
);
135136
mainGroup = 60CB81D12CDA442700873DD6;
136137
minimizedProjectReferenceProxies = 1;
138+
packageReferences = (
139+
7B0318C12CDBA8A30026C613 /* XCRemoteSwiftPackageReference "SwiftLint" */,
140+
);
137141
preferredProjectObjectVersion = 77;
138142
productRefGroup = 60CB81DB2CDA442700873DD6 /* Products */;
139143
projectDirPath = "";
@@ -156,6 +160,27 @@
156160
};
157161
/* End PBXResourcesBuildPhase section */
158162

163+
/* Begin PBXShellScriptBuildPhase section */
164+
7B0318C02CDBA6FF0026C613 /* SwiftLint */ = {
165+
isa = PBXShellScriptBuildPhase;
166+
buildActionMask = 2147483647;
167+
files = (
168+
);
169+
inputFileListPaths = (
170+
);
171+
inputPaths = (
172+
);
173+
name = SwiftLint;
174+
outputFileListPaths = (
175+
);
176+
outputPaths = (
177+
);
178+
runOnlyForDeploymentPostprocessing = 0;
179+
shellPath = /bin/sh;
180+
shellScript = "./Scripts/SwiftLintRunScript.sh\n";
181+
};
182+
/* End PBXShellScriptBuildPhase section */
183+
159184
/* Begin PBXSourcesBuildPhase section */
160185
60CB81D62CDA442700873DD6 /* Sources */ = {
161186
isa = PBXSourcesBuildPhase;
@@ -189,6 +214,8 @@
189214
CODE_SIGN_STYLE = Automatic;
190215
CURRENT_PROJECT_VERSION = 1;
191216
DEVELOPMENT_TEAM = B3PWYBKFUK;
217+
ENABLE_APP_SANDBOX = NO;
218+
ENABLE_USER_SCRIPT_SANDBOXING = NO;
192219
GENERATE_INFOPLIST_FILE = YES;
193220
INFOPLIST_FILE = PhotoGether/Resource/Info.plist;
194221
INFOPLIST_KEY_CFBundleDisplayName = "포토게더";
@@ -223,6 +250,8 @@
223250
CODE_SIGN_STYLE = Automatic;
224251
CURRENT_PROJECT_VERSION = 1;
225252
DEVELOPMENT_TEAM = B3PWYBKFUK;
253+
ENABLE_APP_SANDBOX = NO;
254+
ENABLE_USER_SCRIPT_SANDBOXING = NO;
226255
GENERATE_INFOPLIST_FILE = YES;
227256
INFOPLIST_FILE = PhotoGether/Resource/Info.plist;
228257
INFOPLIST_KEY_CFBundleDisplayName = "포토게더";
@@ -392,6 +421,17 @@
392421
defaultConfigurationName = Release;
393422
};
394423
/* End XCConfigurationList section */
424+
425+
/* Begin XCRemoteSwiftPackageReference section */
426+
7B0318C12CDBA8A30026C613 /* XCRemoteSwiftPackageReference "SwiftLint" */ = {
427+
isa = XCRemoteSwiftPackageReference;
428+
repositoryURL = "https://github.com/realm/SwiftLint";
429+
requirement = {
430+
kind = upToNextMajorVersion;
431+
minimumVersion = 0.57.0;
432+
};
433+
};
434+
/* End XCRemoteSwiftPackageReference section */
395435
};
396436
rootObject = 60CB81D22CDA442700873DD6 /* Project object */;
397437
}

PhotoGether/PhotoGether.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 87 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

PhotoGether/Scripts/.swiftlint.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# .swiftlint.yml
2+
3+
# 일반적인 설정
4+
opt_in_rules:
5+
# 강제 언래핑 시 경고
6+
- force_unwrapping
7+
8+
# 강제 캐스팅 시 경고
9+
force_cast:
10+
warning
11+
12+
# 강제 try 시 경고
13+
force_try:
14+
warning
15+
16+
disabled_rules:
17+
- trailing_whitespace
18+
- file_length
19+
20+
# 중괄호 앞 띄어쓰기 안할 시 경고
21+
opening_brace:
22+
severity: warning # 명시적으로 선언
23+
24+
# 2연속 줄바꿈 제한
25+
vertical_whitespace:
26+
severity: warning
27+
28+
# 코드 글자 수 한 줄당 120자 제한
29+
line_length:
30+
warning: 120
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
if test -d "/opt/homebrew/bin/"; then
2+
PATH="/opt/homebrew/bin/:${PATH}"
3+
fi
4+
5+
export PATH
6+
7+
YML="$(dirname "$0")/.swiftlint.yml"
8+
9+
if which swiftlint > /dev/null; then
10+
swiftlint --config ${YML}
11+
else
12+
echo "warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint"
13+
fi

0 commit comments

Comments
 (0)