-
Notifications
You must be signed in to change notification settings - Fork 11
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
feat: bump_version()
only works in interactive sessions or if NEWS.md
has a preamble (or both)
#638
Conversation
R/fledgling.R
Outdated
@@ -177,8 +177,9 @@ read_fledgling <- function() { | |||
date <- read_date() | |||
|
|||
news_and_preamble <- read_news() | |||
news_and_preamble[["preamble"]] <- news_and_preamble[["preamble"]] %||% news_preamble() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved the preamble "filling" here in order to be able to use read_news()
for checking whether there's a preamble in the NEWS.md
file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Do we even need preamble_in_file
? We can leave it for now, but if it doesn't prove super necessary we can also remove it in the next iteration.
0734f40
to
95fe674
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Let's keep the API unchanged for now.
@@ -1,6 +1,6 @@ | |||
# File editing ------ | |||
|
|||
update_news_impl <- function(commits, which) { | |||
update_news_impl <- function(commits, which, fledgeling = NULL) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would the following be an anti-pattern, violating https://design.tidyverse.org/def-short.html and similar?
update_news_impl <- function(commits, which, fledgeling = NULL) { | |
update_news_impl <- function(commits, which, fledgeling = read_fledgeling()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think using NULL is the right choice?
The most common approach is to use NULL as a sentinel value that indicates that the argument is optional, but non-trivial.
Co-authored-by: Kirill Müller <krlmlr@users.noreply.github.com>
Co-authored-by: Kirill Müller <krlmlr@users.noreply.github.com>
e4a74d0
to
09e0c94
Compare
bump_version()
only works in interactive sessions or if NEWS.md
has a preamble (or both)
Thanks! |
Fix #596