-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
New xml format #7947
New xml format #7947
Conversation
I'm excited for this PR. XML has been a weak spot for a long time. |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #7947 +/- ##
==========================================
+ Coverage 68.25% 68.55% +0.30%
==========================================
Files 620 620
Lines 99355 99600 +245
==========================================
+ Hits 67813 68284 +471
+ Misses 31542 31316 -226
|
I'd still vote to re-run the CI and land this when it's green. It's better than what we have now. |
Seconding @fdncred. I vote we should land this, too. |
This should get mentioned as a breaking change/new feature in the 0.77 blog post. @NotLebedev do you have time to write that up today or would you like someone else to? nushell/nushell.github.io#800 |
Yes I have time. Will do shortly. |
# Description Add `xaccess`,`xupdate` and `xinsert` scripts to standard library. They allow accessing and manipulating data in new xml format #7947 with relative ease. Access some data in nushell xml structure: ![image](https://user-images.githubusercontent.com/17511668/224785447-317359e2-1430-4dfc-9307-73f1d5e50098.png) Update attributes of xml tags matching a path: ![image](https://user-images.githubusercontent.com/17511668/224785506-85e9aa30-b36b-43db-af1d-2f4460563124.png) # User-Facing Changes New commands `std xaccess`, `std xupdate` and `std xinsert` # Tests + 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 -- --check` to check standard code formatting (`cargo fmt --all` applies these changes) - `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A clippy::needless_collect` to check that you're using the standard code style - `cargo test --workspace` to check that all tests pass > **Note** > from `nushell` you can also use the `toolkit` as follows > ```bash > use toolkit.nu # or use an `env_change` hook to activate it automatically > toolkit check pr > ``` # After Submitting If your PR had any user-facing changes, update [the documentation](https://github.com/nushell/nushell.github.io) after the PR is merged, if necessary. This will help us keep the docs up to date.
`from xml` in modern `nu` has different shape. Output is now a series of records with tag, attributes and content fields nushell/nushell#7947
Description
Changes old
from xml
to xml
data formats. See #7682 for reasoning behind this change.Output is now a series of records with
tag
,attributes
andcontent
fields.Old:
![image](https://user-images.githubusercontent.com/17511668/224508728-92d37c1f-ebac-4d5c-924d-bebd60f5cf85.png)
![image](https://user-images.githubusercontent.com/17511668/224508753-a2de338a-ff2a-41e0-bbc1-ccc07a1d00ce.png)
New:
User-Facing Changes
New output/input format, better error handling for
from xml
andto xml
commands.Tests + 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 -- --check
to check standard code formatting (cargo fmt --all
applies these changes)cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A clippy::needless_collect
to check that you're using the standard code stylecargo test --workspace
to 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.