-
Notifications
You must be signed in to change notification settings - Fork 12
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
Random idea: take inspiration from http4s Headers
?
#2
Comments
This sounds really interesting - sounds like I need to read up about http4s |
Had some time to have a look at the
I think that we would lose the ability to manipulate different keys in different scopes by doing this (which admittedly doesn't work very well at the moment). |
@DavidGregory084 heh, sorry if I wasn't so clear. Besides the fact that in sbt My observation is essentially that in http4s Circling back to sbt and sbt-tpolecat, IIUC the way you are doing things now is:
Instead I am proposing this:
Let me know if that makes more sense 😅 |
Just a random idea I've been brewing, feel free to tell me I'm being dumb
It seems to me a lot of the trickiness with
scalacOptions
is that in userland we want to operate (add/remove) with a higher-level DSL (which is what this library provides) but the underlying representation is a rawSeq[String]
.I assume this has motivated the approach in sbt-tpolecat where
tpolecatScalacOptions
is defined in terms of the DSL and it is intended that all operations are done on that setting, and the plugin then writes it intoscalacOptions
. Unfortunately this has shortcomings as well e.g. typelevel/sbt-tpolecat#60 or typelevel/sbt-tpolecat#102.While reviewing an http4s PR I realized that the
Headers
model is super similar to maybe what we want here. Notably,Headers
is represented as a raw sequence ofCIString -> String
tuples but users are able to interact with it elegantly using the various model classes. I wonder if we could adopt a similar design pattern here.I haven't fully worked out how it would actually work in sbt, but the rough idea would be that all interactions should be done by applying DSL-based operations directly to the
scalacOptions
setting. I think this would get us the wins while avoiding the traps.Thoughts?
The text was updated successfully, but these errors were encountered: