False positives when using let_var_whitespace with string interpolation.
swiftlint version
0.32.0
.swiftlint.yml
whitelist_rules:
- let_var_whitespace
main.swift
(maybe, false positive)
let a = "\(1)"
private let b = "" // Variable Declaration Whitespace Violation: Let and var should be separated from other statements by a blank line. (let_var_whitespace)
If I remove string interpolation from the code, no violation found.
let a = ""
private let b = "" // OK
Or removing private from second line is also no violation.
let a = "\(1)"
let b = "" // OK
$ swiftlint lint
Loading configuration from '.swiftlint.yml'
Linting Swift files at paths
Linting 'main.swift' (1/1)
/path/to/main.swift:2:1: warning: Variable Declaration Whitespace Violation: Let and var should be separated from other statements by a blank line. (let_var_whitespace)
Done linting! Found 1 violation, 0 serious in 1 file.
swiftlint version to be sure)? 0.32.0homebrewwhitelist_rules:
- let_var_whitespace
This is caused by a SourceKit bug: https://github.com/realm/SwiftLint/pull/2720#issuecomment-483112662
Looks like this was fixed as part of Swift 5.1 馃挴
Most helpful comment
Looks like this was fixed as part of Swift 5.1 馃挴