You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Multiline method / function parameter declarations must have one parameter per line, with the first parameter starting on a new line and the closing parenthesis on a line by itself as in PSR-2.
Disable line_length when most of the line is a string literal.
// swiftlint:disable:next directive comments should have an explanatory text formatted like // swiftlint:disable:next line_length -- exceeding line_length is better than using concatenation to break a string literal here.
modifier_order sometimes fails to respect the atPrefix before public configuration, which causes it to behave erratically. Because of this, we had to disable the rule. Since we actually want this rule, we should fix it.
closure_end_indentation is buggy when the expression that declares the closure's opening brace is not the first expression on its line, e.g:
foo(
bar:"").then{ _ in
// baz
}.done{ _ in // <-- false positive in this line
// baz
}
opening_brace is buggy when implicitly returning a closure from a map() etc., e.g.
letresult=[1,2,3].map{ value ->(()->Void)in{print("value is \(value)")} // <-- false positive in this line
}
Add config option to discouraged_optional_collection and ImplicitlyUnwrappedOptionalConfiguration for ignoring override properties.
vertical_whitespace_opening_braces is buggy when the first member of a scope is a comment, e.g.
structFoo{
// MARK: - Foo
varfoo:String}
colon is buggy when moving protocol conformances to separate lines in type declarations:
classFoo:String,Equatable{
// ...
}
Idea: Add an analyzer rule that checks types fo conformance to ExpressibleByStringLiteral and that respective initializations use strings.
operator_usage_whitespace does not apply to ranges (e.g. 0..<count)
overridden_super_call does not trigger on missing super call
internaloverridefunc setup(){
// We need to set a slightly darker color for the disabled state, that doesn't conform to the design specification,
// because we are creating the "inverted" background color via the tint color that is used also for the text.
// Otherwise the color from the design-guide would be too light.
self.disabledColor =.gray
}
unused_declaration produces false positive for Swift 5.2 callable values, i.e. func callAsFunction)
We need to write a few more SwiftLint lints for style conventions which are important to us, but which SwiftLint does not support yet:
return
must be preceded by a blank line unless it is the only statement in a block. (Add new rule to SwiftLint for linting newlines beforereturn
statements #47)line_length
when most of the line is a string literal.// swiftlint:disable:next
directive comments should have an explanatory text formatted like// swiftlint:disable:next line_length -- exceeding line_length is better than using concatenation to break a string literal here.
multiline_function_chains
is buggy when chaining promises (e.g. it will trigger on https://github.com/VIISON/POSApp/blob/479c76811bcecbcfa5a909421505f783f2fc43a3/POS/Controllers/Alerts/ShouldChangeCustomerGroupAlert.swift#L46) - we need to fix this and re-enable it.modifier_order
sometimes fails to respect theatPrefix
beforepublic
configuration, which causes it to behave erratically. Because of this, we had to disable the rule. Since we actually want this rule, we should fix it.closure_end_indentation
is buggy when the expression that declares the closure's opening brace is not the first expression on its line, e.g:opening_brace
is buggy when implicitly returning a closure from amap()
etc., e.g.discouraged_optional_collection
andImplicitlyUnwrappedOptionalConfiguration
for ignoringoverride
properties.vertical_whitespace_opening_braces
is buggy when the first member of a scope is a comment, e.g.colon
is buggy when moving protocol conformances to separate lines in type declarations:ExpressibleByStringLiteral
and that respective initializations use strings.operator_usage_whitespace
does not apply to ranges (e.g.0..<count
)overridden_super_call
does not trigger on missingsuper
callunused_declaration
produces false positive for Swift 5.2 callable values, i.e.func callAsFunction
)explicit_self
produces false positive for access to aprojectedValue
of@propertyWrapper
s, i.e.foo.$bar
(Fix false positive in SwiftLint ruleexplicit_self
when usingprojectedValue
of a property wrapper #67)The text was updated successfully, but these errors were encountered: