-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.swiftlint.yml
99 lines (87 loc) · 4.82 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
disabled_rules: # rule identifiers to exclude from running
- file_length # https://realm.github.io/SwiftLint/file-line-length
- line_length # https://realm.github.io/SwiftLint/line-length
- type_name # https://realm.github.io/SwiftLint/type-name
- type_body_length # https://realm.github.io/SwiftLint/type-body-length
- identifier_name # https://realm.github.io/SwiftLint/identifier-name
- notification_center_detachment # https://realm.github.io/SwiftLint/notification-center-detachment
- trailing_comma # https://realm.github.io/SwiftLint/trailing-comma
- multiline_arguments # https://realm.github.io/SwiftLint/multiline-arguments
- unused_closure_parameter # https://realm.github.io/SwiftLint/unused-closure-parameter
- discouraged_optional_collection # https://realm.github.io/SwiftLint/discouraged-optional-collection
- force_cast # https://realm.github.io/SwiftLint/force-cast
- no_fallthrough_only # https://realm.github.io/SwiftLint/no-fallthrough-only
- opening_brace # https://realm.github.io/SwiftLint/opening_brace
- nesting # https://realm.github.io/SwiftLint/nesting
- function_parameter_count # https://realm.github.io/SwiftLint/function_parameter_count
- for_where # https://realm.github.io/SwiftLint/for_where
# these rules were temporarily disabled
- force_try
- empty_count
# This need to be enabled later
- todo
- large_tuple
- multiple_closures_with_trailing_closure
- xctfail_message
opt_in_rules: # some rules are only opt-in
- empty_count # https://realm.github.io/SwiftLint/empty-count
- closure_end_indentation # https://realm.github.io/SwiftLint/closure-end-indentation
- closure_spacing # https://realm.github.io/SwiftLint/closure-spacing
- collection_alignment # https://realm.github.io/SwiftLint/collection-element-alignment
- empty_string # https://realm.github.io/SwiftLint/empty-string
- empty_xctest_method # https://realm.github.io/SwiftLint/empty-xctest-method
- literal_expression_end_indentation # https://realm.github.io/SwiftLint/literal-expression-end-indentation
- modifier_order # https://realm.github.io/SwiftLint/modifier-order
- operator_usage_whitespace # https://realm.github.io/SwiftLint/operator-usage-whitespace
- overridden_super_call # https://realm.github.io/SwiftLint/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
- unavailable_condition # https://realm.github.io/SwiftLint/unavailable_condition.html
# Some rules that may be useful:
# - file_types_order # https://realm.github.io/SwiftLint/file-types-order
# - implicit_return # https://realm.github.io/SwiftLint/implicit-return
# - type_contents_order # https://realm.github.io/SwiftLint/type-contents-order
# More rules can be found here: https://github.com/realm/SwiftLint/blob/master/Rules.md
excluded: # paths to ignore during linting. Takes precedence over `included`.
- Pods
- ExampleApp/Pods
- fastlane
- third-party
reporter: "xcode" # reporter type (xcode, json, csv, checkstyle, junit, html, emoji, sonarqube, markdown)
cyclomatic_complexity:
warning: 20
error: 30
function_body_length:
warning: 120
error: 150
custom_rules:
no_print:
name: "Printing to console"
message: "No direct printing to console is allowed. Please use PMLog class from vpncore library."
regex: "(^\\s*print\\()|(NSLog)"
match_kinds:
- identifier
excluded: ExampleApp/
#file_header:
# severity: error
# required_pattern: |
# \/\/
# \/\/ .*?\.swift
# \/\/ ProtonCore.* - Created on \d{1,4}.\d{1,2}.\d{2,4}.?
# \/\/
# \/\/ Copyright \(c\) \d{4} Proton (Technologies )?AG
# \/\/
# \/\/ This file is part of (Proton Technologies AG and )?ProtonCore\.
# \/\/
# \/\/ ProtonCore is free software: you can redistribute it and\/or modify
# \/\/ it under the terms of the GNU General Public License as published by
# \/\/ the Free Software Foundation, either version 3 of the License, or
# \/\/ \(at your option\) any later version\.
# \/\/
# \/\/ ProtonCore is distributed in the hope that it will be useful,
# \/\/ but WITHOUT ANY WARRANTY; without even the implied warranty of
# \/\/ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE\..? See the
# \/\/ GNU General Public License for more details\.
# \/\/
# \/\/ You should have received a copy of the GNU General Public License
# \/\/ along with ProtonCore\..? If not, see <?https:\/\/www\.gnu\.org\/#dlicenses\/>?\.