-
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
WarningConfig DSL #9
base: main
Are you sure you want to change the base?
Conversation
Thank you for opening a pull request @satorg. I refrained from doing that to have a discussion on the design with the maintainers before contributing it, but I guess it can happen here as well. I would appreciate if you included me as a co-author in the git commit message:
|
@laughedelic oh, sorry. Seems I misread your last sentence in the issue's description as a suggestion to open a pr on your behalf. Sorry about that. Feel free to open your pr please and I'm going to close this one. Thanks! |
Oh, I really didn't mean that I have anything against this PR. Sorry if it appeared so! 😅 Please, feel free to reopen and carry on, I think it will be better since you seem more familiar with the codebase here 👍 My only ask was an acknowledgement for the initial contribution, but it's not really important. |
Sure, here it is. Sorry for the misunderstanding and thank you for the great idea! |
7fb4e68
to
124bc1d
Compare
Even more things to consider. It seems that Scala3 has got a different set of message filters comparing to Scala2. Below is output from Scala v3.2.0 for
Note that there's no Therefore, it seems that instances of Furthermore, it seems that different Scala versions may have different sets of supported |
Scala 3 is quite different, so it's unlikely |
That's fair. I wonder though, could we rely on this basic syntax remains unchanged:
Despite that filters and actions can be different in future Scala3 versions... |
Thanks for raising this @satorg and thanks @laughedelic for the suggestion!
I agree that it would probably be better to provide this via an explicit import rather than adding it to the base package of the library. Perhaps something like Alternatively, we could nest all of the DSL classes inside an
Personally I prefer to avoid this, just because for debug purposes it obscures the existence of the
Yes, I like that idea - what if we provided a |
Yes it would :) At least, looks good to me. Either way would work I think. But personally, I would like to have it consistent with the "core" DSL. I mean, currently the core DSL is imported from the Otherwise if we prefer more package-like import path (i.e. |
I would say initially I was considering a package-like import paths everywhere. But I've kinda reconsidered that and now leaning towards just putting it into the
I.e. it makes easier to switch between either importing'em all or importing just DSL objects and use them as prefixes for DSL entries. |
160c12b
to
dfcaacc
Compare
Co-authored-by: Alexey Alekhin <[email protected]>
See #4.
I just went ahead and copied the suggested DSL into the project (kudos to @laughedelic, thank you!).
Topics to discuss:
The DSL classes location. Personally I would prefer to keep DSL and utility classes separated. I.e. I'd like to import DSLs from a dedicated package like:
which would only import names corresponding to the target DSL, i.e.
silent
,error
,cat
,msg
, etc, but NOTWarningConfig
norWarningFilter
.The same thoughts regarding more common option names like
deprecation
,feature
,unchecked
,lint
,fatalWarnings
– from my prospective all those should be separated from such utility methods likeoptionsForVersion
,tokensForVersion
and so on.Rendering to the target language via
toString
. Just not sure if it is the best way to render.The
asScalacOption
method. Usually utility methods insideScalacOptions
take on buildingScalacOption
, so perhaps this logic would be more appropriate out there.