handling nested list types
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 42/100
Research direction
Reproduce the panic by reading the shown rv.lock data with tomledit::read_toml() and tomledit::get_item(toml_data, "packages"). Start with src/to_robj.rs, then inspect the lockfile-related structures referenced from rv's src/lockfile.rs. Done means mixed string and nested-table dependency entries parse without the ExpectedString panic.
Written by the indexing model from the issue text.
Description
in rv's new lockfile format, we're capturing dependency constraints if they exist in the dependencies array
So a field can now look like:
[[packages]]
name = "gsm.app"
version = "2.4.0"
source = { git = "https://github.com/gilead-biostats/gsm.app", sha = "2bade6a78617abc9154f3c92117012260a5477b5", tag = "v2.4.0" }
force_source = true
dependencies = [
"bslib",
"cli",
"dplyr",
"favawesome",
"glue",
"gsm.core",
"gsm.kri",
{ name = "gt", requirement = "(>= 0.11.1.9000)" },
"htmltools",
"htmlwidgets",
"jsonlite",
"magrittr",
"purrr",
"rlang",
{ name = "shiny", requirement = "(>= 1.6.0)" },
"shinyjs",
"shinyWidgets",
"yaml",
]
and when calling tomledit get the following:
> toml_data <- tomledit::read_toml("rv.lock")
> tomledit::get_item(toml_data, "packages")
thread '<unnamed>' panicked at src/to_robj.rs:96:34:
called `Result::unwrap()` on an `Err` value: ExpectedString(list!(name=["gt"], requirement=["(>= 0.11.1.9000)"]))
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
so the parsing needs another layer.
here is a complete snippet from an rv.lock file with version 2 syntax:
# This file is automatically @generated by rv.
# It is not intended for manual editing.
version = 2
r_version = "4.4"
[[packages]]
name = "DBI"
version = "1.2.3"
source = { repository = "https://prism.dev.a2-ai.cloud/rpkgs/stratus/2025-04-26" }
force_source = false
dependencies = []
[[packages]]
name = "DT"
version = "0.33"
source = { repository = "https://prism.dev.a2-ai.cloud/rpkgs/stratus/2025-04-26" }
force_source = false
dependencies = [
{ name = "htmltools", requirement = "(>= 0.3.6)" },
{ name = "htmlwidgets", requirement = "(>= 1.3)" },
"httpuv",
{ name = "jsonlite", requirement = "(>= 0.9.16)" },
"magrittr",
"crosstalk",
"jquerylib",
"promises",
]
[[packages]]
name = "Matrix"
version = "1.7-1"
source = { builtin = true }
force_source = false
dependencies = [
"lattice",
]
if you want to see the src code for any reason to see the data/structures where toml stuff is being called on creation:
- Dominant language
- R
- Stars
- 14
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from extendr/tomledit
All issues in extendr/tomledit
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
-
ai-discovered area: data explorer
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
posit-dev/positron#16530 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
modeling question
Difficulty 2/5 1-3 hours Newbie friendliness 75/100