forked from ProtonVPN/ios-mac-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.swiftlint.yml
64 lines (58 loc) · 4.42 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
disabled_rules: # rule identifiers to exclude from running
- file_length # https://github.com/realm/SwiftLint/blob/master/Rules.md#file-line-length
- line_length # https://github.com/realm/SwiftLint/blob/master/Rules.md#line-length
- type_name # https://github.com/realm/SwiftLint/blob/master/Rules.md#type-name
- type_body_length # https://github.com/realm/SwiftLint/blob/master/Rules.md#type-body-length
- identifier_name # https://github.com/realm/SwiftLint/blob/master/Rules.md#identifier-name
- trailing_whitespace # https://github.com/realm/SwiftLint/blob/master/Rules.md#trailing-whitespace
- notification_center_detachment # https://github.com/realm/SwiftLint/blob/master/Rules.md#notification-center-detachment
- trailing_comma # https://github.com/realm/SwiftLint/blob/master/Rules.md#trailing-comma
- multiline_arguments # https://github.com/realm/SwiftLint/blob/master/Rules.md#multiline-arguments
- unused_closure_parameter # https://github.com/realm/SwiftLint/blob/master/Rules.md#unused-closure-parameter
- discouraged_optional_collection # https://github.com/realm/SwiftLint/blob/master/Rules.md#discouraged-optional-collection
- force_cast # https://github.com/realm/SwiftLint/blob/master/Rules.md#force-cast
- force_try # https://realm.github.io/SwiftLint/force_try.html
- no_fallthrough_only # https://github.com/realm/SwiftLint/blob/master/Rules.md#no-fallthrough-only
- private_over_fileprivate # https://github.com/realm/SwiftLint/blob/master/Rules.md#private_over_fileprivate
- for_where # https://realm.github.io/SwiftLint/for_where.html
- large_tuple # https://realm.github.io/SwiftLint/large_tuple.html
- nesting # https://realm.github.io/SwiftLint/nesting.html
- redundant_string_enum_value # https://realm.github.io/SwiftLint/redundant_string_enum_value.html
- void_function_in_ternary # https://realm.github.io/SwiftLint/void_function_in_ternary.html
- multiple_closures_with_trailing_closure # Disabled to make SwiftUI code look better: https://realm.github.io/SwiftLint/multiple_closures_with_trailing_closure.html
opt_in_rules: # some rules are only opt-in
- empty_count # https://github.com/realm/SwiftLint/blob/master/Rules.md#empty-count
- closure_end_indentation # https://github.com/realm/SwiftLint/blob/master/Rules.md#closure-end-indentation
- closure_spacing # https://github.com/realm/SwiftLint/blob/master/Rules.md#closure-spacing
- collection_alignment # https://github.com/realm/SwiftLint/blob/master/Rules.md#collection-element-alignment
- empty_string # https://github.com/realm/SwiftLint/blob/master/Rules.md#empty-string
- empty_xctest_method # https://github.com/realm/SwiftLint/blob/master/Rules.md#empty-xctest-method
- literal_expression_end_indentation # https://github.com/realm/SwiftLint/blob/master/Rules.md#literal-expression-end-indentation
- modifier_order # https://github.com/realm/SwiftLint/blob/master/Rules.md#modifier-order
- operator_usage_whitespace # https://github.com/realm/SwiftLint/blob/master/Rules.md#operator-usage-whitespace
- overridden_super_call # https://github.com/realm/SwiftLint/blob/master/Rules.md#overridden-methods-call-super
- prohibited_super_call # https://github.com/realm/SwiftLint/blob/master/Rules.md
- sorted_first_last # https://github.com/realm/SwiftLint/blob/master/Rules.md
# Some rules that may be useful:
# - file_types_order # https://github.com/realm/SwiftLint/blob/master/Rules.md#file-types-order
# - implicit_return # https://github.com/realm/SwiftLint/blob/master/Rules.md#implicit-return
# - type_contents_order # https://github.com/realm/SwiftLint/blob/master/Rules.md#type-contents-order
# More rules can be found here: https://github.com/realm/SwiftLint/blob/master/Rules.md
#included: # paths to include during linting. `--path` is ignored if present.
# - ProtonVPN
#excluded: # paths to ignore during linting. Takes precedence over `included`.
# - Carthage
# - Pods
# - ProtonVPN/ObfuscatedConstants.swift
reporter: "xcode" # reporter type (xcode, json, csv, checkstyle, junit, html, emoji, sonarqube, markdown)
custom_rules:
no_print:
name: "Printing to console"
message: "No direct printing to console is allowed. Please use `log` from vpncore library."
regex: "(^\\s*print\\()|(NSLog)"
match_kinds:
- identifier
hardcoded_assets:
name: "Hardcoded Assets"
message: "Prefer type-safe assets generated by SwiftGen over assets referenced by hardcoded literals."
regex: "UIImage\\(named:.*\\)"