Skip to content

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