Hacker News new | ask | show | jobs
by willtemperley 166 days ago
Yes swift-format will say "never force-unwrap" because it is a potential crash.
1 comments

No it will not.
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'

You’ve turned that on; it’s off by default for good reasons: https://github.com/swiftlang/swift-format/blob/02c5a88a32719...
That's the standard for swiftlang CI which is what I use.
I don’t think it is?