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

Drop locate argument everywhere public-facing #183

Merged
merged 5 commits into from
Oct 18, 2024
Merged

Drop locate argument everywhere public-facing #183

merged 5 commits into from
Oct 18, 2024

Conversation

richfitz
Copy link
Member

This PR drops the locate argument which was inconsistently present, had inconsistent arguments and was inconsistently used. We now search for the root from root (usually NULL) in all cases.

Calls to root_open have been slightly simplified by adding a reasonable default for call; doing that everywhere is another bit of maintenance we can do later

@richfitz richfitz marked this pull request as ready for review October 17, 2024 11:27
@richfitz richfitz requested a review from plietar October 17, 2024 11:27
Copy link
Member

@plietar plietar left a comment

Choose a reason for hiding this comment

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

LGTM, just two minor further possible cleanups.

R/root.R Outdated
@@ -140,7 +139,7 @@ empty_config_contents <- function() {
## * also check that the outpack and orderly path are compatibible
## (this is actually quite hard to get right, but should be done
## before anything is created I think)
root_open <- function(path, locate, require_orderly = FALSE, call = NULL) {
root_open <- function(path, require_orderly = FALSE, call = parent.frame()) {
if (is.null(call)) {
Copy link
Member

Choose a reason for hiding this comment

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

Can we remove this line? Presumably no where calls this with an explicit call = NULL.

R/root.R Outdated
@@ -140,7 +139,7 @@ empty_config_contents <- function() {
## * also check that the outpack and orderly path are compatibible
## (this is actually quite hard to get right, but should be done
## before anything is created I think)
root_open <- function(path, locate, require_orderly = FALSE, call = NULL) {
root_open <- function(path, require_orderly = FALSE, call = parent.frame()) {
Copy link
Member

Choose a reason for hiding this comment

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

Seems you've added values for require_orderly everywhere - would it be worth removing the default?

@richfitz richfitz merged commit 1b65946 into main Oct 18, 2024
10 checks passed
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.

2 participants