generated from bitwarden/template
-
Notifications
You must be signed in to change notification settings - Fork 27
/
.swiftlint.yml
111 lines (100 loc) · 2.53 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
analyzer_rules:
- unused_declaration
- unused_import
disabled_rules:
- non_optional_string_data_conversion
- todo
- trailing_whitespace # Covered by SwiftFormat
- vertical_whitespace # Covered by SwiftFormat
opt_in_rules:
- anonymous_argument_in_multiline_closure
- attributes
- 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
- fallthrough
- file_name
- file_name_no_space
- first_where
- identical_operands
- missing_docs
- multiline_arguments
- multiline_parameters
- operator_usage_whitespace
- prefer_zero_over_explicit_init
- sorted_imports
- sorted_first_last
- static_operator
- toggle_bool
- type_contents_order
- unneeded_parentheses_in_closure_argument
- unowned_variable_capture
- yoda_condition
excluded:
- BitwardenShared/UI/Platform/Application/Support/Generated
- BitwardenWatchApp
- BitwardenWatchShared
- build
- vendor/bundle
attributes:
always_on_same_line:
- "@Environment"
cyclomatic_complexity:
ignores_case_statements: true
multiline_arguments:
only_enforce_after_first_closure_on_first_line: true
trailing_comma:
mandatory_comma: true
type_contents_order:
order:
- case
- type_alias
- associated_type
- subtype
- type_property
- instance_property
- ib_inspectable
- ib_outlet
- initializer
- deinitializer
- type_method
- view_life_cycle_method
- ib_action
- other_method
- subscript
identifier_name:
excluded:
- id
inclusive_language:
override_allowed_terms:
- masterKey
- masterPassword
custom_rules:
style_guide_font:
name: "Style Guide Font"
regex: "(.font\\(.system)"
message: "Prefer using a style guide font over the system fonts, for example: \".font(.styleGuide(.body))\""
match_kinds:
- identifier
severity: warning
todo_without_jira:
name: "TODO without JIRA"
regex: "(TODO|TO DO|FIX|FIXME|FIX ME|todo)(?!: (BIT|PM)-[0-9]{1,})" # "TODO: BIT-123"
message: "All TODOs must be followed by a JIRA reference, for example: \"TODO: BIT-123\""
match_kinds:
- comment
severity: warning
weak_navigator:
name: "Weak Navigator"
regex: "(?<!weak )(var|let) \\w*[nN]avigator: \\w*Navigator"
message: "Navigator references must be weak to avoid memory leaks."
severity: error
excluded:
- ".*Tests\\.swift"