-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.swiftlint.yaml
51 lines (42 loc) · 2.1 KB
/
.swiftlint.yaml
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
disabled_rules: # 실행에서 제외할 룰 식별자들
- redundant_optional_initialization # 옵셔널 변수를 명시적으로 nil로 초기화하는 중복 제거 규칙 제외
- force_cast # 강제 형변환 사용 제한
- force_try # 예외 처리 없이 try! 사용 제한
- function_body_length # 함수 본문의 행 길이 제한
- statement_position # 조건문, 반복문 등의 코드 블록 위치를 일정하게 유지하는 규칙 제외
- closure_end_indentation # 클로저 끝 부분 들여쓰기 규칙 제외
opt_in_rules: # 선택적으로 추가하는 규칙
- empty_count # .count == 0보다 isEmpty 사용 권장
- empty_string # == ""보다 isEmpty 사용 권장
- sorted_imports # import 구문 알파벳 순서로 정렬
- vertical_whitespace # 불필요한 개행 줄 제한
analyzer_rules: # 코드 분석을 위한 규칙
- unused_import # 사용되지 않는 import 구문 경고
- unused_declaration # 사용되지 않는 선언 경고
included: # SwiftLint 검사에 포함되는 경로
- Source
excluded: # SwiftLint 검사에서 제외되는 경로
- Carthage
- Pods
# 커스텀 최대 행 길이 규칙
line_length:
warning: 120 # 120자를 초과할 시 경고
ignores_urls: true # URL도 최대 길이 규칙에 제외
ignores_comments: true # 주석은 최대 길이 규칙에서 제외
ignores_interpolated_strings: true # 문자열 보간법 사용 시 최대 길이 규칙 제외
# 커스텀 공백 규칙
trailing_whitespace:
ignores_empty_lines: false # 빈 줄에서 공백 허용 제외
# 기타 커스텀 규칙
custom_rules:
non_final_class: # final이 없는 클래스 선언 탐지
name: "Non-final Class"
regex: 'class\s+[A-Z][A-Za-z]+'
message: "Consider marking this class as final if it's not intended for inheritance."
severity: warning
prohibit_lower_snake_case: # lower_snake_case 식별자 탐지
name: "Prohibit Lower Snake Case"
regex: "[a-z]+_[a-z]+"
message: "Identifiers should not be written in lower snake case."
severity: warning
reporter: "xcode" # 리포트 형식 설정 (xcode 형식)