async-http-client icon indicating copy to clipboard operation
async-http-client copied to clipboard

Code formatting

Open artemredkin opened this issue 5 years ago • 3 comments

Should we use https://github.com/apple/swift-format for our formatting needs?

artemredkin avatar Sep 28 '20 10:09 artemredkin

Just for reference that other projects are still using the https://github.com/nicklockwood/SwiftFormat tool ( https://github.com/apple/swift-metrics/blob/main/scripts/sanity.sh#L52 etc)

I kind of remember we're at a stale-mate with regards to moving over to apple/swift-format because it has not yet been "blessed with an official style" etc... I have no idea if it's worth to keep waiting or what we should do from a "less churn" perspective.

I think @tomerd knows more here -- about if we should move on to apple/swift-format yet or keep waiting.

ktoso avatar Sep 28 '20 14:09 ktoso

swiftformat version 0.44.6 is used https://github.com/swift-server/async-http-client/blob/main/docker/Dockerfile#L34 with configs in .swiftformat.

Formatting with HEAD version (0.46.3) of swift format with current config introduces some formatting changes. Should we update version and our configs or move to some other tool?

ya-pulser avatar Sep 28 '20 14:09 ya-pulser

I was bitten by the tool changing formatting with versions as well... that has been annoying when projects get out of sync :-( We don't really have a guarantee the same won't be happening now with apple/swift-format though.

ktoso avatar Sep 28 '20 14:09 ktoso