-
Notifications
You must be signed in to change notification settings - Fork 27
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
Treat Config/Needs/website
like Imports
?
#122
Comments
I think the removal of that white space happens right here? Line 809 in daece0e
|
Came here to say the same thing 😄 |
It would be great if it behaves just like It doesn't require a lot of custom code to achieve part of it, but it would be great not to have it (or at least an option to enable this identical behavior). tf <- tempfile()
text <- "Package: test\nImports: tdplyr, tibble\nConfig/Needs/website: tidyverse/tidytemplate, r-lib/desc"
# Single line for Needs
desc <- desc::description$new(text = text)
desc$normalize()
desc$write(file = tf)
readLines(tf) |> paste0(collapse = "\n") |> cat()
#> Package: test
#> Imports:
#> tdplyr,
#> tibble
#> Config/Needs/website: tidyverse/tidytemplate, r-lib/desc
#
desc <- desc::description$new(text = text)
desc$normalize()
desc_field_name <- "Config/Needs/website"
if (desc$has_fields(desc_field_name)) {
tmp_list <- desc$get_list(desc_field_name)
desc$set_list(desc_field_name, tmp_list, sep = ",\n ")
}
desc$write(file = tf)
readLines(tf) |> paste0(collapse = "\n") |> cat()
#> Package: test
#> Imports:
#> tdplyr,
#> tibble
#> Config/Needs/website: tidyverse/tidytemplate,
#> r-lib/desc Created on 2023-10-25 with reprex v2.0.2 |
I ran
use_tidy_description()
on a package with:and it converted it to:
Notice that it also removed the space, which seems wrong. At the very least I think it should keep that.
I managed to reproduce this with dev desc. The other weird thing is that if you run
use_tidy_description()
again on the "tidied" file, then it adds the space back.Created on 2022-01-25 by the reprex package (v2.0.1)
The text was updated successfully, but these errors were encountered: