Skip to content
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

config: migrate underlying data structure to toml_edit #5060

Merged
merged 3 commits into from
Dec 10, 2024

Conversation

yuja
Copy link
Collaborator

@yuja yuja commented Dec 9, 2024

Checklist

If applicable:

  • I have updated CHANGELOG.md
  • I have updated the documentation (README.md, docs/, demos/)
  • I have updated the config schema (cli/src/config-schema.json)
  • I have added tests to cover my changes

yuja added 3 commits December 9, 2024 23:18
This patch does not change the handling of inline tables yet. Both inline and
non-inline tables are merged as before. OTOH, .set_value() is strict about table
types because it should refuse to overwrite a table whereas an inline table
should be overwritten as a value. This matches "jj config set"/"unset"
semantics. rules_from_config() in formatter.rs uses .as_inline_table(), which is
valid because toml_edit::Value type never contains non-inline table.

Since toml_edit::Value doesn't implement PartialEq, stacking tests now use
insta::assert_snapshot!().
toml_edit uses IndexMap internally, so the order of table items is
deterministic.
@yuja yuja force-pushed the push-pzxroqnvzlxq branch from 2e00e2a to 061adac Compare December 9, 2024 14:19
CHANGELOG.md Show resolved Hide resolved
@yuja yuja merged commit 1c7634f into jj-vcs:main Dec 10, 2024
18 checks passed
@yuja yuja deleted the push-pzxroqnvzlxq branch December 10, 2024 03:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants