extendr / rextendr

An R package that helps scaffolding extendr-enabled packages or compiling Rust code dynamically
https://extendr.github.io/rextendr/
Other
197 stars 27 forks source link

check for empty string in use_crate() #388

Closed kbvernon closed 1 week ago

kbvernon commented 2 months ago

To address https://github.com/extendr/rextendr/issues/387, this PR adds a check for empty strings when running purrr::discard() on the cargo_add_opts list.

CGMossa commented 2 months ago

How do we know that this works? Is it possible to add a test? Otherwise I'd just merge.

kbvernon commented 2 months ago

yes, this function needs a test. i'll look into adding one tomorrow!

kbvernon commented 2 weeks ago

Pasting flags and values together into single character scalars is the wrong way to pass additional arguments to processx::run(), so I opted to concatenate them into a character vector. This has the advantage of making purrr::discard() unnecessary, as concatenating drops NULL values.

JosiahParry commented 1 week ago

@kbvernon one last test! can you test the optional feature? The nifty codecov tool shows that it is missing a check :)

JosiahParry commented 1 week ago

100% code cov? You're crazy for that.

codecov[bot] commented 1 week ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 79.76%. Comparing base (5478786) to head (cb1c985). Report is 1 commits behind head on main.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/extendr/rextendr/pull/388/graphs/tree.svg?width=650&height=150&src=pr&token=5H6ID0LAO7&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=extendr)](https://app.codecov.io/gh/extendr/rextendr/pull/388?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=extendr) | [Files with missing lines](https://app.codecov.io/gh/extendr/rextendr/pull/388?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=extendr) | Coverage Δ | | |---|---|---| | [R/use\_crate.R](https://app.codecov.io/gh/extendr/rextendr/pull/388?src=pr&el=tree&filepath=R%2Fuse_crate.R&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=extendr#diff-Ui91c2VfY3JhdGUuUg==) | `100.00% <100.00%> (+100.00%)` | :arrow_up: |