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

Collapse almost everything into a single SwiftFormat module. #593

Merged
merged 9 commits into from Aug 16, 2023

Conversation

allevato
Copy link
Collaborator

Historically swift-format has been internally split into many modules—Core, Rules, PrettyPrint, WhitespaceLinter. These were implementation details, and SwiftFormat is the only module that provides public API that users should import. There's not much advantage to having this structure, and (until we start using the package access level at some point), this leaked implementation details as public declarations.

This PR reorganizes everything so there are only two primary modules: SwiftFormatConfiguration (unchanged from before), and SwiftFormat (everything else). @_spi is used where needed to make certain declarations visible to tests (or to generate-pipeline) but keep them otherwise hidden from normal clients.

Move `Core`, `PrettyPrint`, `Rules`, and `WhitespaceLinter` tests into
subdirectories of a new `SwiftFormatTests` target. (`WhitespaceLinter`
is folded into the `PrettyPrint` subdirectory.)
This indicates that it should not be used by users. (In the future, it
should use `package` access-level declarations.)
…dules into `SwiftFormat`.

This only moves files and updated imports; access level changes and SPIs will be
introduced later.
These changes are only the ones that don't cause compilation errors.
These are part of the public API; they were originally in `SwiftFormatCore`
but reexported by `SwiftFormat`.
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.

None yet

1 participant