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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

scalafix-codegen sbt-plugin? #1674

Open
armanbilge opened this issue Sep 15, 2022 · 2 comments
Open

scalafix-codegen sbt-plugin? #1674

armanbilge opened this issue Sep 15, 2022 · 2 comments

Comments

@armanbilge
Copy link

Sorry, yet-another-upstream-idea 馃榿

The idea is basically to turn this example project into a plugin:
https://github.com/olafurpg/scalafix-codegen/blob/7fdaa50a94cc31ae7af2d2237c91bc9611b17fe1/build.sbt

I know it's a small snippet, but after copying it between a few projects gets old fast. So it would be cool to add it as a small plugin to sbt-scalafix, would that be of interest?

@bjaglin
Copy link
Collaborator

bjaglin commented Sep 16, 2022

Sorry, yet-another-upstream-idea grin

Keep them coming! I don't have a bandwidth to actively contribute these weeks (I have been reactive mostly), but I am definitely open to reviews.

I know it's a small snippet, but after copying it between a few projects gets old fast. So it would be cool to add it as a small plugin to sbt-scalafix, would that be of interest?

For sure, a ScalafixCodegenPlugin would be nice. Happy to see the scenarios you use it for, and maybe discuss how the plugin would work for a client here in this issue before going to implementation mode. https://github.com/hamnis/dataclass-scalafix/blob/main/readme.md is also derived from the same snippet, taking into account semantic rules (I suspect/hope we can remove the need for 2 separate projects by making ScalafixCodegenPlugin & ScalafixPlugin coordinate somehow).

@armanbilge
Copy link
Author

Awesome, thanks! We are using it for generating sources from GraphQL schema. And possibly in the future for enhancing Scala.js facades as well.
https://github.com/gemini-hlsw/explore/blob/14af551f7fc3e0f51404b0b56b975f013924867f/build.sbt#L125-L137

Thanks for the pointer to the other example, we are also currently using the two-project setup. That's interesting about removing the need for that, I didn't realize that could be possible. Interesting :)

In lieu of discussion here I might put up a draft PR, I don't understand the pieces here well enough without actually playing with the code.

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

2 participants