logoalt Hacker News

willtemperleyyesterday at 10:24 AM1 replyview on HN

Are you sure about that?

let x: Int? = 0

let y: Int = x!

git ls-files -z -- '*.swift' | xargs -0 swift format lint --parallel

error: [NeverForceUnwrap] do not force unwrap 'x'


Replies

saagarjhayesterday at 10:39 AM

You’ve turned that on; it’s off by default for good reasons: https://github.com/swiftlang/swift-format/blob/02c5a88a32719...

show 1 reply