-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.swiftlint.yml
More file actions
94 lines (78 loc) · 1.69 KB
/
.swiftlint.yml
File metadata and controls
94 lines (78 loc) · 1.69 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
opt_in_rules:
- empty_count
disabled_rules:
- opening_brace
- missing_docs # 对 AI 生成代码过于严格
- multiple_closures_with_trailing_closure # SwiftUI 风格代码常用
- large_tuple # 测试代码中常用
- todo # 允许 TODO 注释
- non_optional_string_data_conversion # 避免过度限制数据转换
included:
- Sources
- Tests
excluded:
- .build
- .swiftpm
- Generated
trailing_comma:
mandatory_comma: false # 不强制要求尾随逗号,以兼容 Linux Swift 6.0
severity: warning
line_length:
warning: 300
error: 320 # 进一步放宽行长度限制
ignores_comments: true
ignores_urls: true
force_cast: warning
force_try:
severity: warning
file_length:
warning: 1200 # 放宽文件长度限制
error: 1500
function_body_length:
warning: 110 # 适应复杂函数需求
error: 160
type_body_length:
warning: 500 # 适应大型类型需求
error: 750
function_parameter_count:
warning: 8 # 适应复杂函数参数需求
error: 12
type_name:
min_length: 3
max_length:
warning: 40
error: 50
excluded:
- ID
identifier_name:
allowed_symbols: "_"
min_length:
warning: 1 # 允许单字符变量名
error: 1
excluded:
- id
- URL
- GlobalAPIKey
- i
- x
- y
- z
- by
- fg # Fill 相关
- bg # Fill 相关
- d # Date 相关
- d1 # Date 相关
- d2 # Date 相关
- s # String 相关
- ts # Timestamp 相关
nesting:
type_level:
warning: 4 # 放宽嵌套限制
error: 8
cyclomatic_complexity:
warning: 35 # 适应复杂逻辑需求
error: 45
switch_case_alignment:
severity: warning
indented_cases: true # 允许 case 缩进
reporter: "xcode"