-
Notifications
You must be signed in to change notification settings - Fork 285
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
Let use_package()
decrement a package dependency.
#2043
Conversation
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.
Looking good! I had a couple comments/questions.
R/helpers.R
Outdated
direction <- ifelse(version_spec(version) > version_spec(existing_version), | ||
"Increasing", "Decreasing") |
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.
Can you change this to an if () ... else
? I generally reserve ifelse()
for vectorized situations.
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.
Sure!
R/helpers.R
Outdated
"Increasing", "Decreasing") | ||
|
||
ui_bullets(c( | ||
"v" = "{.drn {direction}} {.pkg {package}} version to {.val {version}} in |
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'm not familiar with the .drn
inline markup. Can you help me understand that?
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 just tried to replicate the same logic as in {.pkg {package}}
and{.val {version}}
. I tried to remove .drn
and then {direction}
would not resolve with the string in the object direction
. Any hint?
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.
Something like {.pkg {package}}
does interpolation of package
through its surrounding brackets. Then .pkg
and the second layer of brackets applies some inline styling.
For pure interpolation (which is the goal with direction
), we just need one pair of brackets.
You can learn more about this in the cli package: https://cli.r-lib.org/reference/inline-markup.html.
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 for pointing this out, and thanks again for your time and patience today!
Fixes #1957.