Use Apple's GitHub Workflows linting script#42
Conversation
This reverts commit f5cdfb3.
| @@ -1,4 +1,5 @@ | |||
| import XCTest | |||
|
|
|||
There was a problem hiding this comment.
I actually can't find out why this wasn't reported before. This is needed based on how swift-format behaves.
Did some tests locally, it would sometimes randomly emit a warning about this, and sometimes not.
I couldn't find out what makes it care about that line, and what makes it not. Tried different configurations as well
...
There was a problem hiding this comment.
I'm strongly against needing the newline, frankly... If swift-format is demanding it, to me that's a bug in swift-format. Imports should be grouped together unless there are a lot of them and they fall naturally into sectioning.
There was a problem hiding this comment.
We are at a point of "it is what it is" with swift-format. I'd suggest you give up as well. The configuration that Apple repos use also has the same behavior IIRC.
I think it requires the new line because the next import is a @testable one.
There was a problem hiding this comment.
Yeah, obviously it does but to me it's visually jarring and completely pointless to have that gap. Why should @testable imports be separated?
(I know, I know, swift-format isn't gonna change... but there should really be more control.)
gwynne
left a comment
There was a problem hiding this comment.
I must say there are a lot of ways in which I don't like the direction swift-format has taken. For all its issues, swiftformat always impressed me more with its flexibility.
The script is configured to respect a
.swiftformatignorefile which I'll need for Penny.swift-format might soon have this ability in itself: swiftlang/swift-format#873