-
Notifications
You must be signed in to change notification settings - Fork 1
/
.swiftlint.yml
112 lines (100 loc) · 2.9 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
excluded:
- .build
strict: true
disabled_rules:
# All of the default rules of type "metrics". We have no reason to believe that the arbitrary defaults picked by SwiftLint are helpful.
- cyclomatic_complexity
- file_length
- function_body_length
- function_parameter_count
- large_tuple
- line_length
- nesting
- type_body_length
# Rules of type "lint" that we’ve decided we don’t want:
- todo # We frequently use TODOs accompanied by a GitHub issue reference
opt_in_rules:
# All of the opt-in rules of type "performance":
- 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
- first_where
- flatmap_over_map_reduce
- last_where
- reduce_into
- sorted_first_last
# Opt-in rules of type "style" that we’ve decided we want:
- attributes
- closure_end_indentation
- closure_spacing
- collection_alignment
- comma_inheritance
- conditional_returns_on_newline
- file_header
- implicit_return
- literal_expression_end_indentation
- modifier_order
- multiline_arguments
- multiline_arguments_brackets
- multiline_function_chains
- multiline_literal_brackets
- multiline_parameters
- multiline_parameters_brackets
- operator_usage_whitespace
- prefer_self_type_over_type_of_self
- self_binding
- single_test_class
- sorted_imports
- switch_case_on_newline
- trailing_closure
- trailing_newline
- unneeded_parentheses_in_closure_argument
- vertical_parameter_alignment_on_call
- vertical_whitespace_closing_braces
- vertical_whitespace_opening_braces
# Opt-in rules of type "idiomatic" that we’ve decided we want:
- anonymous_argument_in_multiline_closure
- convenience_type
- fallthrough
- fatal_error_message
- pattern_matching_keywords
- redundant_type_annotation
- shorthand_optional_binding
- static_operator
- toggle_bool
- xct_specific_matcher
# Opt-in rules of type "lint" that we’ve decided we want:
- array_init
- empty_xctest_method
- override_in_extension
- yoda_condition
- private_swiftui_state
file_header:
# The aim of this rule is to make sure that we delete the Xcode-generated boilerplate comment, which looks like
#
# //
# // File.swift
# // AblyChat
# //
# // Created by Lawrence Forooghian on 15/08/2024.
# //
forbidden_pattern: // Created by
type_name:
&no_length_checks # We disable the length checks, for the same reason we disable the rules of type "metrics".
min_length:
warning: 1
max_length:
warning: 10000
generic_type_name: *no_length_checks
identifier_name:
<<: *no_length_checks
allowed_symbols:
# Allow underscore; it can be handy for adding a prefix to another identifier (e.g. our testsOnly_<identifier> convention)
- _
# For compatibility with SwiftFormat
trailing_comma:
mandatory_comma: true