When we write the following code:
private func handleError(error: MyError) {
switch dispatch(error: error) {
case .retryMode:
if startTime + args.retryDuration < .now() {
completion(Result(error: .other))
} else {
oneMoreTime()
}
case .failed(let anotherError):
completion(Result(error: anotherError))
}
}
It outputs the following:
private func handleError(error: MyError) {
switch dispatch(error: error) {
case .retryMode:
if startTime + args.retryDuration < .now {
completion(Result(error: .other))
} else {
oneMoreTime()
}
case .failed(let anotherError):
completion(Result(error: anotherError))
}
}
Which triggers a compilation error
$ swiftlint lint
Can't do this due to company rules
swiftlint version to be sure)?0.40.3
homebrew
Can't do this due to company rules
# insert yaml contents here
xcodebuild -version)?11.7
echo "[string here]" | swiftlint lint --no-cache --use-stdin --enable-all-rulesswiftlint lint --path [file here] --no-cache --enable-all-rules.// This triggers a violation:
let foo = try! bar()
@mime29 It doesn't clear what is the issue here.
Can you clarify?
@PaulTaykalo DispatchTime.now() gets transformed into DispatchTime.now (line 4, .now() -> .now)
@lordzsolt Are you trying to perform autocorrection?
If so, what is your config?
linting itself shouldn't do any harm
Okay, got it.