-
Notifications
You must be signed in to change notification settings - Fork 286
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
Don't instruct usage if no changes in use_package()
#1384
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.
A snapshot test would be perfect I think. And add a news bullet?
Ok, style updated, test added, and news updated! |
Just to provide some history, |
Co-authored-by: Hadley Wickham <[email protected]>
🤣 ok, I'll always use |
Thanks! |
If I do
use_package("pre.existing.import", "Suggests")
,use_dependency()
warns me that no change will be made. However,how_to_use()
doesn't know about this, so it still tells you how to use the given type.This PR prevents
use_package()
anduse_dev_package()
from callinghow_to_use()
if no change has been made.I thought to add a test for this little bug, but I don't know how to express the expectation "A warning, followed by no messages". Maybe just a snapshot test?
PS I actually don't understand the logic here, TBH. Why does usethis care if I'm shuffling dependencies around in the first place? And why does it let me move up the dependency ladder but not down?