-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementIssues that describe new features or improvements to existing features.Issues that describe new features or improvements to existing features.
Description
We need to write a few more SwiftLint lints for style conventions which are important to us, but which SwiftLint does not support yet:
-
returnmust be preceded by a blank line unless it is the only statement in a block. (Add new rule to SwiftLint for linting newlines beforereturnstatements #47) - 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_lengthwhen most of the line is a string literal. -
// swiftlint:disable:nextdirective 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_chainsis 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_ordersometimes fails to respect theatPrefixbeforepublicconfiguration, 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_indentationis 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_braceis buggy when implicitly returning a closure from amap()etc., e.g.let result = [1, 2, 3].map { value -> (() -> Void) in { print("value is \(value)") } // <-- false positive in this line }
- Add config option to
discouraged_optional_collectionandImplicitlyUnwrappedOptionalConfigurationfor ignoringoverrideproperties. -
vertical_whitespace_opening_bracesis buggy when the first member of a scope is a comment, e.g.struct Foo { // MARK: - Foo var foo: String }
-
colonis buggy when moving protocol conformances to separate lines in type declarations:class Foo: String, Equatable { // ... }
- Idea: Add an analyzer rule that checks types fo conformance to
ExpressibleByStringLiteraland that respective initializations use strings. -
operator_usage_whitespacedoes not apply to ranges (e.g.0..<count) -
overridden_super_calldoes not trigger on missingsupercallinternal override func 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_declarationproduces false positive for Swift 5.2 callable values, i.e.func callAsFunction) -
explicit_selfproduces false positive for access to aprojectedValueof@propertyWrappers, i.e.foo.$bar(Fix false positive in SwiftLint ruleexplicit_selfwhen usingprojectedValueof a property wrapper #67)
Metadata
Metadata
Assignees
Labels
enhancementIssues that describe new features or improvements to existing features.Issues that describe new features or improvements to existing features.