Skip to content

Migrate generate-pipeline to a SwiftPM build tool plug-in. #416

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 1 commit into from
Oct 10, 2022

Conversation

allevato
Copy link
Member

The biggest change that isn't just the plug-in use itself is how we detect opt-in rules now. The previous version "cheated" by linking the rules themselves into generate-pipeline and then used some dynamic class lookup to get the actual value at runtime. This was replaced with a syntax tree scan that looks for a simple true or false return value in a static/class property named isOptIn. (A future version of swift-format should probably use compile-time constants for this property, when that's officially supported.)

The biggest change that isn't just the plug-in use itself is how we
detect opt-in rules now. The previous version "cheated" by linking
the rules themselves into `generate-pipeline` and then used some
dynamic class lookup to get the actual value at runtime. This was
replaced with a syntax tree scan that looks for a simple `true` or
`false` return value in a static/class property named `isOptIn`.
(A future version of swift-format should probably use
compile-time constants for this property, when that's officially
supported.)
@allevato
Copy link
Member Author

cc @dylansturg

@@ -1,31 +1,5 @@
# Developing `swift-format`

## Keeping the Pipeline and Tests Updated
Copy link
Contributor

Choose a reason for hiding this comment

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

🎉

@allevato allevato merged commit 3e5f224 into swiftlang:main Oct 10, 2022
@allevato allevato deleted the generate-pipeline-plugin branch October 10, 2022 22:15
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