-
Notifications
You must be signed in to change notification settings - Fork 247
Allow comments in .swift-format
#1014
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow comments in .swift-format
#1014
Conversation
Unfortunately it looks like We'll need to guard this property (and the test) appropriately. For conciseness, we could use @ahoppen Do you think that's ok or would you prefer a more explicit check involving something like the compiler version on non-Apple OSes? |
I would prefer to check for a compiler version on non-Darwin OSs because that’s something that’s easier to remove in the future. It’s easy to tell that |
XCTAssertEqual(config.reflowMultilineStringLiterals, expectedBehavior) | ||
} | ||
} | ||
|
||
func testConfigurationWithComments() throws { | ||
#if !canImport(Darwin) && compiler(<6) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll need to wrap the rest of the body in an #else
here, too, otherwise it will still try to compile the code below in the compiler(<6)
case (since it's just unguarded code right now).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Enable allowsJSON5 on the
JSONDecoder
. With this change, the decoder can now parse JSON5-formatted data.Resolves #1011.