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

use_version() leaves behind development header if preceding newlines exist in NEWS #1976

Open
kevinushey opened this issue Apr 11, 2024 · 0 comments · May be fixed by #1977
Open

use_version() leaves behind development header if preceding newlines exist in NEWS #1976

kevinushey opened this issue Apr 11, 2024 · 0 comments · May be fixed by #1977

Comments

@kevinushey
Copy link
Contributor

kevinushey commented Apr 11, 2024

In renv, I had a NEWS file with the structure:


# renv (development version)

* Fixed an issue where downloads could fail with curl >= 8.7.1. (#1869)

< ... >

Note the leading empty line. When I then ran usethis::use_version("patch"), the NEWS file was modified as:

diff --git a/NEWS.md b/NEWS.md
index bc58b2c79..d2b02c0da 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,3 +1,5 @@
+# renv 1.0.6
+

 # renv (development version)

Note that the old development version NEWS header was unexpectedly retained. Could the check in:

usethis/R/news.R

Lines 49 to 55 in 9e64daf

development_title <- glue("# {project_name()} (development version)")
if (development_title == news[[1]]) {
news[[1]] <- title
ui_bullets(c("v" = "Replacing development heading in {.path NEWS.md}."))
return(write_utf8(news_path, news))
}

skip leading whitespace / empty lines?

@kevinushey kevinushey linked a pull request Apr 11, 2024 that will close this issue
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 a pull request may close this issue.

1 participant