Skip to content
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

format all swift sources, enable format checks #109

Closed
wants to merge 2 commits into from

Conversation

ktoso
Copy link
Collaborator

@ktoso ktoso commented Oct 25, 2024

One of those "it has to be done someday" tasks... enabling formatting checking and formatting all Swift sources.

This is just the swift format Sources --recursive --in-place invocation.

We can tweak the config if we don't like the output but it'll be nice to have consistent formatting.

WDYT?

@@ -35,7 +35,7 @@ public func globalTakeIntInt(i: Int, j: Int) {
p("i:\(i), j:\(j)")
}

public func globalCallMeRunnable(run: () -> ()) {
public func globalCallMeRunnable(run: () -> Void) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

c'mon, seriously swift-format? 🤪

(pretty sure that'll break some things since we checked the () -> () string 😅 )

var funcDecl = ImportedFunc(
parentName: self.parentName,
identifier: self.identifier,
returnType: TranslatedType.void,
parameters: [.init(param: newValueParam, type: self.returnType)])
funcDecl.swiftMangledName = self.swiftMangledName + "s" // form mangled name of the getter by adding the suffix
funcDecl.swiftMangledName = self.swiftMangledName + "s" // form mangled name of the getter by adding the suffix
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

weird decision by swift-format here...

@ktoso
Copy link
Collaborator Author

ktoso commented Oct 25, 2024

Uncovered fun bug in swift-format: swift-format breaks compilation by wrongly reformatting nested multi-line string blocks swiftlang/swift-format#864

@ktoso ktoso closed this Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant