Skip to content

Conversation

@ahoppen
Copy link
Member

@ahoppen ahoppen commented Nov 13, 2025

To understand whether a PR breaks the formatting behavior of real-world code, add a GitHub action that formats a small set of real world projects and ensures that swift-format lint does not produce any errors.

Run that shows how this workflow looks like if it discovers a failure: https://github.com/ahoppen/swift-format/actions/runs/19324836211/job/55273496880?pr=13

Since this job currently doesn’t pick up related PRs when checking out the projects to format, I would not mark it as a required check right now. Rather, I’d like to just run this to provide some signal to the author of a PR and to be able to decide if the formatting change is acceptable or not.

…lot projects

To understand whether a PR breaks the formatting behavior of real-world code, add a GitHub action that formats a small set of pilot projects and ensures that `swift-format lint` does not produce any errors.
@allevato
Copy link
Member

Very nice!

Is there a way we could get the diff of the code before and after running the just-built swift-format? That would be even more helpful to see in the logs than just the lint warnings about spaces and such.

@bnbarham
Copy link
Contributor

Is there a way we could get the diff of the code before and after running the just-built swift-format?

Could do a format + git diff instead? I can update after if you'd prefer to just get this in @ahoppen

@ahoppen
Copy link
Member Author

ahoppen commented Nov 14, 2025

I was thinking the same but we also need to run swift-format lint because there are some issues that will be discovered during linting, like having lowercase types.

Since we need to run the linting step anyway, I’d suggest getting this in as-is and doing the git diff approach in a follow-up PR.

@allevato
Copy link
Member

Since we need to run the linting step anyway, I’d suggest getting this in as-is and doing the git diff approach in a follow-up PR.

Works for me!

@ahoppen ahoppen merged commit a3f634e into swiftlang:main Nov 14, 2025
28 of 29 checks passed
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.

3 participants