forked from luowen1991/SwiftBilibili
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.swiftlint.yml
53 lines (52 loc) · 1.51 KB
/
.swiftlint.yml
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
disabled_rules: # 执行时排除掉的规则
- colon
- comma
- control_statement
- missing_docs
- large_tuple
- multiple_closures_with_trailing_closure
- redundant_string_enum_value
- function_body_length
opt_in_rules: # 一些规则仅仅是可选的
- empty_count
# 可以通过执行如下指令来查找所有可用的规则:
# swiftlint rules
excluded: # 执行 linting 时忽略的路径。 优先级比 `included` 更高。
- Carthage
- Pods
- Sources/ExcludedFolder
- Sources/ExcludedFile.swift
# 可配置的规则可以通过这个配置文件来自定义
# 二进制规则可以设置他们的严格程度
force_cast: warning # 隐式
force_try: warning # 显式
# 同时有警告和错误等级的规则,可以只设置它的警告等级
# 隐式
line_length: 200
# 可以通过一个数组同时进行隐式设置
type_body_length:
- 300 # warning
- 400 # error
# 或者也可以同时进行显式设置
file_length:
warning: 500
error: 1200
# 命名规则可以设置最小长度和最大程度的警告/错误
# 此外它们也可以设置排除在外的名字
type_name:
min_length: 2 # 只是警告
max_length: # 警告和错误
warning: 40
error: 50
excluded: iPhone # 排除某个名字
allowed_symbols: ["_"]
identifier_name:
min_length: # only min_length
warning: 1
error: 1 # only error
excluded: # excluded via string array
- id
- URL
- GlobalAPIKey
reporter: "xcode" # 报告类型 (xcode, json, csv, checkstyle)
cyclomatic_complexity: 30