Repository navigation
Std xml utils - #8437
Std xml utils#8437
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #8437 +/- ##
==========================================
- Coverage 68.16% 68.13% -0.03%
==========================================
Files 631 620 -11
Lines 101963 99723 -2240
==========================================
- Hits 69502 67951 -1551
+ Misses 32461 31772 -689 |
|
thanks for your contribution! 👋 the thing is i do not know XML at all, so i do not really know what to test and what behaviour to look after 😮 for instance open Cargo.toml | to xmldoes not even work 😆 in the meantime, i'll have a look at the source (but it looks already quite good and well documented, i like that 😏) |
amtoine
left a comment
There was a problem hiding this comment.
i really do not understand the XML format, that's even the first time i see it for real i think 😮
so i'll trust you and other XML-experts that the new xml module does what it's supposed to do 😌
only minor remarks and i'm wondering if aligning the right operands of the asserts would make them a bit easier to read?
i do not know, as you feel is the best.
|
Finished this. Fixed all recommendations, added one more useful command. Regarding
this is the reason why this commands are required at all. Xml is a weird format among others because it is not a tabular or key-value format (which are easy to use in nushell) but a strange tag-attributes-content model, allowing repetitions of entries but placing many other arbitrary restrictions. This is why TL;DR xml does not map on json-like formats well, thus it can not be mapped one-to one with most nushell values in a sensible way. |
|
thanks for the explaination, much appreciate it ❤️ i'm gonna review right now as it's ready 💪 |
amtoine
left a comment
There was a problem hiding this comment.
a few little things, we're close 😋
|
@NotLebedev can we resolve the conflicts so we can land this please? |
|
Thanks! |
|
@NotLebedev any ideas why I'm getting errors with |
|
Sorry @NotLebedev - it was my fault. i had another |

Description
Add
xaccess,xupdateandxinsertscripts to standard library. They allow accessing and manipulating data in new xml format #7947 with relative ease.Access some data in nushell xml structure:

Update attributes of xml tags matching a path:

User-Facing Changes
New commands
std xaccess,std xupdateandstd xinsertTests + Formatting
Don't forget to add tests that cover your changes.
Make sure you've run and fixed any issues with these commands:
cargo fmt --all -- --checkto check standard code formatting (cargo fmt --allapplies these changes)cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A clippy::needless_collectto check that you're using the standard code stylecargo test --workspaceto check that all tests passAfter Submitting
If your PR had any user-facing changes, update the documentation after the PR is merged, if necessary. This will help us keep the docs up to date.