-
Notifications
You must be signed in to change notification settings - Fork 123
Conversation
548421e
to
1920096
Compare
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.
Looks very good, thank you for the improvements of the error messages. The unit tests are very nicely written, too.
@markus2330 But at least the failing example from #3491 with the base64 metamode should work now as intended (without any need of knowing that metamode is on). |
Thank you so much, great work 🎆 |
@bauhaus93 thank you for implementing so many improvements to the TOML plugin. This is even more important than #3098. 😉 |
@bauhaus93 @markus2330 Currently
(
( |
Please avoid making new proposals in PRs, this could be easily misunderstood. Status-quo is:
Lines 1072 to 1074 in f370cc5
and here also the meta-spec for type: Lines 223 to 244 in f370cc5
If unsupported types are encountered during |
Yes, |
Thank you, I clarified in d198a7e |
@markus2330 I think this PR is now in a working state. My suggestion would be to merge this and then I'll use new PR(s) to fix the remaining TOML issues (see #3910). If we do a release soon, we should wait until after the release with the merge, or remove the semi-functional comment-based metadata handling from the PR. |
Yes, the idea is to release asap so that Harald can continue with his work, see #3908. I think its best if we remove the "semi-functional comment-based metadata handling from the PR" as the specs in TOML is not urgent and having a otherwise working TOML is important&urgent. |
I think this is now ready to be merged (assuming the build servers are happy). I removed the metadata handling for now (new handling will be added in a new PR). I did not yet copy the string quoting stuff from #3478, because I found some issues with the existing code. I will add a new version in another PR. |
Didn't allow leading zeros after e/E, but is now a valid.
Empty key names (written in empty quotes) now allowed for any kind of keyname (in k/v assignments, simple tables, table arrays, inline tables).
Tests contain one roundtrip file, which gets read and written and is then checked if it's same under disregard of whitespace (and currently also quotation characters). Tests also contain some invalid TOML files, which should fail on read. The parser considers some invalid TOML files as valid, mainly related to invalid table/table array combinations/redefinitions. Additionally, need to check the correct handling of multiline strings, they somehow are not fine yet.
String quote counter would not be reset when reading a non-quote character, which caused strings to be considered finished prematurely.
Previously, did not check any range for integers on reading/writing. Now added checks for that. On reading, will emit an error if a syntactically correct integer exceeds the range of ulonglong/longlong. On writing, value will not be seen as integer, but written as string instead. Also fixed incorrect float checking in type.c (Out-of-range integers would get interpreted as floats, because commas were optional).
On writing, a `boolean` typed key must now be either 0 or 1, otherwise an error will be emitted.
Metakeys are now written as comments with a prefix on writing. On reading, those special comments will get assigned as metakeys to a key. This is currently just a very basic implementation, which assumes that the metakey name/values don't have any special characters / are binary. Also, metakey names are currently expected to not contain any spaces. Tests for this changes not yet added/adapted.
Fixed a general comment error, which occured within list elements. Needed to add an additional newline before writing comments in certain situations, otherwise a value preceding comment would get written as an inline comment of the previous list value instead.
For now, no comments will be written in direct children of inline tables.
It's illegal.
Overall it works better, even if the implementation doesn't fully match the spec.
Thank you so much @bauhaus93 and @kodebach! ❤️ |
Fixing TOML issues mentioned in #3490.
basic
. First tries of that in TOML as default storage plugin #3478.Additional fixes:
Metakey preservation problems:
array
andtomltype
metakey of an table array) doesn't have any anchors in a TOML file.inlinetable
to asimpletable
or we may throw an error in that case.Basics
These points need to be fulfilled for every PR:
(added as entry in
doc/news/_preparation_next_release.md
whichcontains
_(my name)_
)Please always add something to the release notes.
(first line should have
module: short statement
syntax)close #X
, are in the commit messages.If you have any troubles fulfilling these criteria, please write
about the trouble as comment in the PR. We will help you.
But we cannot accept PRs that do not fulfill the basics.
Checklist
Check relevant points but please do not remove entries.
For docu fixes, spell checking, and similar none of these points below
need to be checked.
(not in the PR description)
Review
Reviewers will usually check the following:
Labels
If you are already Elektra developer:
say that everything is ready to be merged.