-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.swiftlint.yml
145 lines (125 loc) · 2.91 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# Last-Checked SwiftLint Version: x.y.z
# Configuration
allow_zero_lintable_files: true
# Overall Rules:
excluded: # paths to ignore during linting. Takes precedence over `included`.
# SwiftLint is using Darwin.glob to resolve file paths, and Darwin.glob simply doesn't support `"**"` as recursive path wildcard.
# https://github.com/realm/SwiftLint/issues/3586#issuecomment-1026861753
- "*/.build"
- ".build"
- "*/DerivedData"
- "Build"
- "DerivedData"
- "Carthage"
- "Pods"
- "vendor"
- "*/SupportingFiles"
- "Danger"
- "Tests"
disabled_rules:
# Rules below are just exceptions under scratch phase and should be re-enabled in the future.
- todo
- inclusive_language
opt_in_rules:
- closure_body_length
- closure_end_indentation
- closure_spacing
- collection_alignment
- contains_over_filter_count
- contains_over_filter_is_empty
- contains_over_first_not_nil
- contains_over_range_nil_comparison
- empty_collection_literal
- empty_count
- empty_string
- enum_case_associated_values_count
- extension_access_modifier
- fatal_error_message
- file_name
- file_name_no_space
- file_types_order
- first_where
- flatmap_over_map_reduce
- identical_operands
- implicitly_unwrapped_optional
# - indentation_width
- last_where
- legacy_multiple
- legacy_random
- literal_expression_end_indentation
- lower_acl_than_parent
- modifier_order
- multiline_arguments_brackets
- multiline_literal_brackets
- multiline_parameters_brackets
- number_separator
- object_literal
- operator_usage_whitespace
- optional_enum_case_matching
- overridden_super_call
- prefer_self_type_over_type_of_self
- prefer_zero_over_explicit_init
- private_action
- private_outlet
- prohibited_super_call
- reduce_into
- single_test_class
- sorted_first_last
- static_operator
- switch_case_on_newline
- test_case_accessibility
- toggle_bool
# - type_contents_order # SwiftUI で init を body の前に置くため
- vertical_parameter_alignment_on_call
- vertical_whitespace_between_cases
- xct_specific_matcher
- yoda_condition
analyzer_rules:
- unused_declaration
- unused_import
# Single-Rule Configurations:
file_name:
excluded:
- Dangerfile.swift
suffix_pattern: "Extensions?|\\+.*"
force_try:
severity: warning
function_parameter_count:
warning: 7
error: 10
identifier_name:
max_length: 50
excluded:
- i
- x
- y
- id
- on
- to
- us
- at
- vc
- ok
- ci
line_length:
ignores_function_declarations: true
ignores_comments: true
warning: 175
error: 300
nesting:
type_level:
warning: 2
function_level:
warning: 5
trailing_comma:
mandatory_comma: true
trailing_whitespace:
ignores_empty_lines: true
number_separator:
minimum_length: 6
type_name:
max_length: 50
vertical_whitespace:
max_empty_lines: 3
cyclomatic_complexity:
ignores_case_statements: true