-
Notifications
You must be signed in to change notification settings - Fork 6
/
.swiftlint.yml
88 lines (75 loc) · 2.31 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
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
excluded: # paths to ignore during linting. Takes precedence over `included`.
- Pods
# By default, SwiftLint uses a set of sensible default rules you can adjust:
disabled_rules: # rule identifiers turned on by default to exclude from running
- trailing_whitespace
- opening_brace
- superfluous_disable_command
- cyclomatic_complexity
opt_in_rules:
- empty_count
- force_unwrapping
- operator_usage_whitespace
- multiline_parameters
- multiline_arguments
- implicitly_unwrapped_optional
- modifier_order
# Fomatting Specific Constructs
# - comment_spacing (default enabled)
# - switch_case_alignment (default enabled)
- switch_case_on_newline
- redundant_string_enum_value
- trailing_closure
# Naming
# - identifier_name (default enabled)
- static_operator
# Programming practices rules
- fallthrough
- force_try
# Alternatively, specify all rules explicitly by uncommenting this option:
# only_rules: # delete `disabled_rules` & `opt_in_rules` if using this
# - empty_parameters
# - vertical_whitespace
analyzer_rules: # Rules run by `swiftlint analyze` (experimental)
- explicit_self
# configurable rules can be customized from this configuration file
# binary rules can set their severity level
force_unwrapping: warning
force_cast: warning # implicitly
force_try:
severity: warning # explicitly
# rules that have both warning and error levels, can set just the warning level
# implicitly
line_length:
warning: 100
error: 200
ignores_comments: true
ignores_function_declarations: true
ignores_interpolated_strings: true
ignores_urls: true
nesting:
type_level: 3
# they can set both implicitly with an array
type_body_length:
- 300 # warning
- 400 # error
# or they can set both explicitly
function_body_length:
warning: 80
file_length:
warning: 500
error: 1200
# naming rules can set warnings/errors for min_length and max_length
# additionally they can set excluded names
type_name:
min_length: 4 # only warning
max_length: # warning and error
warning: 40
error: 50
allowed_symbols: ["_"] # these are allowed in type names
identifier_name:
min_length: # only min_length
warning: 2
max_length:
warning: 35
reporter: "xcode" # reporter type (xcode, json, csv, checkstyle, codeclimate, junit, html, emoji, sonarqube, markdown, github-actions-logging)