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

Shorten reference_pkg argument name to ref #32

Merged
merged 13 commits into from
Sep 13, 2024
Merged

Conversation

edelarua
Copy link
Collaborator

@edelarua edelarua commented Sep 5, 2024

Closes #26

I applied this change to all functions including get_pkg_dependencies() and get_min_version_required() - is this correct? Only the *_pkg_installed() functions were specified in the issue.

@ddsjoberg
Copy link
Owner

Thank you for this PR! It looks like the other PR introduced some conflicts. Can you take a look?

@edelarua edelarua requested a review from ddsjoberg September 5, 2024 23:55
@ddsjoberg
Copy link
Owner

Thinking ahead to when this is more generally used, do you think it's worthwhile to remove the default values for ref = "cards" and pkg = "cards" arguments?

@edelarua
Copy link
Collaborator Author

edelarua commented Sep 6, 2024

Thinking ahead to when this is more generally used, do you think it's worthwhile to remove the default values for ref = "cards" and pkg = "cards" arguments?

We could do that. Would it work (for most cases) if we replaced it with packageName() so the current package is used as the default?

@ddsjoberg
Copy link
Owner

Would it work (for most cases) if we replaced it with packageName() so the current package is used as the default?

OMG I love it! I did NOT know this function existed 😍

Absolutely yes, this should be the default. Can you test it in three locations and update the roxygen text with how it works in those situations?

  1. Regular use inside a function I assume this is where it will work flawlessly.
  2. At the top of a unit testing file. I think there is a good chance it won't work in this setting.
  3. In a roxygen #' @examplesIf tag. I think there is a good chance it won't work in this setting.

If it doesn't work in either scenario 2 or 3, we should probably add a check in the function that the ref is a string with is_string(). I can imagine a situation where I forget to add the pkg name in those cases, and we should ensure the function fails.

@ddsjoberg
Copy link
Owner

@edelarua is this ready for the last review? Thanks!

@edelarua
Copy link
Collaborator Author

@edelarua is this ready for the last review? Thanks!

I think so!

Copy link
Owner

@ddsjoberg ddsjoberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much!
LOVE IT!

@ddsjoberg ddsjoberg merged commit 230ce55 into main Sep 13, 2024
7 checks passed
@ddsjoberg ddsjoberg deleted the 26_shorter_ref_arg_name branch September 13, 2024 21:11
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 this pull request may close these issues.

Rename *_pkg_installed(reference_pkg) argument name
2 participants