Skip to content

Enable some nice-to-have code formatting rules #3110

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

Merged
merged 3 commits into from
Jun 25, 2025
Merged

Enable some nice-to-have code formatting rules #3110

merged 3 commits into from
Jun 25, 2025

Conversation

AnthonyLatsis
Copy link
Contributor

No description provided.

Copy link
Member

@ahoppen ahoppen left a comment

Choose a reason for hiding this comment

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

LGTM. Could you enable the same rules in SourceKit-LSP and swift-format to keep the formatting in those repositories consistent?

@AnthonyLatsis
Copy link
Contributor Author

@AnthonyLatsis
Copy link
Contributor Author

@swift-ci please test

Comment on lines 43 to 50

// This only makes sense void functions
if funcDecl.signature.returnClause?.type.as(IdentifierTypeSyntax.self)?.name.text != "Void" {
if let returnClause = funcDecl.signature.returnClause,
returnClause.type.as(IdentifierTypeSyntax.self)?.name.text != "Void"
{
throw CustomError.message(
"@addAsync requires an function that returns void"
)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ahoppen Had to adjust this because the macro was complaining about a nil result clause not being Void.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for adjusting it. Looks good to me.

@AnthonyLatsis
Copy link
Contributor Author

@swift-ci please test

@AnthonyLatsis
Copy link
Contributor Author

@swift-ci please test Windows

@AnthonyLatsis AnthonyLatsis merged commit c40a978 into main Jun 25, 2025
28 checks passed
@AnthonyLatsis AnthonyLatsis deleted the jepa branch June 25, 2025 18:02
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.

2 participants