-
Notifications
You must be signed in to change notification settings - Fork 880
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
Allow configuration of indentation for YAML and JSON stores #1273
Conversation
aec089f
to
2739358
Compare
In favor of adding support for this but not before 3.9.0. |
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 your contribution! I've some first comments after glancing over the implementation.
For some reason this doesn't compile in CI anymore. The only error printed is |
Meh, actually the problem was on my side - apparently GHA changed some code and the error reports are now loaded from another domain name, which I was blocking by default. |
I found an issue in |
I looked at other opened issues and identified #1048 which we could also fix in this PR. The issue asks for the choice of indent character but for the first version we could already use the added cli option |
How about using tabs if no indent is specified, and the amount of spaces if It might also make sense to allow |
Yes, we could do that, I think it would make sense. |
I applied what we discussed. However, while looking at other issues, #1028 seems to propose having default json indentation with spaces instead of tab to be compatible with yaml parser. I have no idea whether it is a good idea to change the default indentation of json to 4 spaces instead of one tab. |
I tend a bit to keep the tabs. No idea what the other maintainers think though :) In any case, as long as it is possible to explicitly configure indentation by tabs (for example by setting indentation to a negative number) I'm ok with the default changing, assuming there is a majority for changing it.
I would expect it is possible to provide a default value. I'm not that familiar with Go's serialization/deserialization mechanism though... |
I think you can simply assign default values to Lines 252 to 253 in d46b702
|
Great thank you for your feedback, I appreciate it 👍. I implemented a default value of -1 which allows to support no indentation at all if the user provides |
Fixed ! 👍 |
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.
While looking at this again I have some more comments (or maybe I forgot some context from before).
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.
Besides that, looks good to me!
bcd1feb
to
e82b517
Compare
If nobody objects, I'll merge this during the next few days. |
this will allow for setting of parameters specific to each store, such as indentation level for YAML Co-authored-by: Bastien Wermeille <bastien.wermeille@gmail.com> Signed-off-by: James J. Goodhouse <jgoodhouse@newrelic.com>
Signed-off-by: Bastien Wermeille <bastien.wermeille@gmail.com>
Co-authored-by: Felix Fontein <felix@fontein.de> Signed-off-by: Bastien Wermeille <bastien.wermeille@gmail.com>
Signed-off-by: Bastien Wermeille <bastien.wermeille@gmail.com>
Signed-off-by: Bastien Wermeille <bastien.wermeille@gmail.com>
Signed-off-by: Bastien Wermeille <bastien.wermeille@gmail.com>
Signed-off-by: Bastien Wermeille <bastien.wermeille@gmail.com>
Signed-off-by: Bastien <bastien.wermeille@gmail.com>
Signed-off-by: Bastien <bastien.wermeille@gmail.com>
Signed-off-by: Bastien <bastien.wermeille@gmail.com>
@jamesgoodhouse @Ph0tonic thanks a lot for working on this and getting it over the finish line! :) |
Wieee happy to learn that the json files are now being valid YAML files by no longer including tabs! Nice work on this @Ph0tonic @jamesgoodhouse and reviewers! 🎉 |
To be precise by default they still use tabs, but now you can configure sops to use spaces instead of tabs :) |
This PR aims to finish the work started in #930, thanks to @jamesgoodhouse.
I added the use of the Indent param in the store as well as a new
--indent
option in the cli.Let me know what you think about it.
Fixes #900, fixes #1048 and fixes #1028