-
Notifications
You must be signed in to change notification settings - Fork 51
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
feat(JVM): Annotations to set the ScalarStyle on a single field. #596
feat(JVM): Annotations to set the ScalarStyle on a single field. #596
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, the general approach looks good to me.
Could you please also add a comment to the relevant properties on YamlConfiguration
to explain that these annotations take precedence over any configuration there?
I have handled your review comments and it now has 2 annotations YamlWriteSingleLineStringUsingScalarStyle and YamlWriteMultiLineStringUsingScalarStyle. I have also added a few more tests: different combinations of these 2 and having a single or multiline value) I did not (yet) add a similar annotation for the ambiguous case because I did not yet understand how that works and should work. |
15195ec
to
c3aee00
Compare
NOTE: There is no documentation in YamlConfiguration for |
I've handled the feedback as best as I understand what you want to see. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
src/commonMain/kotlin/com/charleskorn/kaml/YamlConfiguration.kt
Outdated
Show resolved
Hide resolved
1cdeea2
to
a9f2232
Compare
Squashed all commits I made to make it a lot cleaner |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. Could you please fix the linting failures?
Thanks @nielsbasjes! |
🎉 This PR is included in version 0.62.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
A first draft of what I asked for in #594
The main problem I faced is that the
fun encodeString(value: String)
as defined by Kotlin does not pass the descriptor and index.So this first attempt works (on my machine) but does make that
this will not work in a multithreaded situation
and multiple yamls are written at the same time by the same instance.So either that problem can be fixed in a different way or it is essentially impossible to build.