swiftlang / swift-format

Formatting technology for Swift source code
Apache License 2.0
2.49k stars 229 forks source link

_lint_ flags things for _OmitExplicitReturns_ but _format_ doesn't fix them #812

Open thomasvl opened 1 month ago

thomasvl commented 1 month ago

With a dummy test file:

var f = l.filter { return $0.a != o }

And a config file that includes:

    "OmitExplicitReturns" : true,
swift format lint --configuration swift-format.cfg test.swift

Produces:

test.swift:1:20: warning: [OmitExplicitReturns] 'return' can be omitted because body consists of a single expression

However

swift format format --configuration swift-format.cfg test.swift

Doesn't actually return the return in what it produces.

ahoppen commented 4 weeks ago

Synced to Apple’s issue tracker as rdar://136555297