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

Use custom source sets and compile-only dependencies instead of reflection #524

Closed
nedtwigg opened this issue Feb 13, 2020 · 0 comments
Closed

Comments

@nedtwigg
Copy link
Member

nedtwigg commented Feb 13, 2020

Spotless supports many formatters, and they have many transitive dependencies. We write most integration code using reflection, so that we don't have to reconcile the conflicting transitive dependencies of every formatter we support.

An easier-to-use, but harder-to-setup method is to create a custom source set with compileOnly dependencies. e.g src/main/java-scalafmt. We're happy to accept piecemeal PR's which do this for any formatter that a contributor is interested in - no need to convert everything.

When contributing a PR of this sort, there is no need to worry about older versions of the formatter - we can always use the old reflection code to maintain support for these old versions if necessary.

Completed examples:

@nedtwigg nedtwigg pinned this issue Jun 5, 2020
nedtwigg added a commit to tisoft/spotless that referenced this issue Sep 30, 2021
nedtwigg added a commit that referenced this issue May 3, 2022
nedtwigg added a commit that referenced this issue Aug 23, 2022
@nedtwigg nedtwigg unpinned this issue Sep 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant