Closed thereseanders closed 5 years ago
Suggestions sound good!
@mine-cetinkaya-rundel or @rundel, could you briefly comment on the two cases below that are not as clear-cut?
local_repo
: currently files
; change to local_path
(note change to singular) for consistency?repo_style
: currently files
; change to path
(note change to singular) for consistency?FYI, I kept files
as an internal object name, for example in file_exists
, and changed only user-facing attribute names. See two examples below:
file_exists = function(repo, path, branch = "master"){
files = repo_files(repo, branch)
purrr::map_lgl(path, ~.x %in% files[["path"]])
}
repo_get_readme = function(repo, branch = "master") {
stopifnot(length(repo) == 1)
stopifnot(length(branch) == 1)
file = purrr::possibly(github_api_repo_get_readme, NULL)(repo, branch)
extract_content(file)
}
I think we've got all of these changed now, I'm going to close this for now but let me know if you find any lingering file
s
Currently, parameter names for files are not consistent across functions (some use
path
, others usefile
).I suggest to use:
path
within functions that make calls to the GitHub API (to match parameter name in API)repo_put_file()
(currentlypath
)repo_get_file()
(currentlyfile
)repo_modify_file()
(currentlyfile
)find_file()
(currentlyfile
)file_exists()
(currentlyfile
)check_file_modification()
(currentlypath
)get_commits()
(currentlypath
)repo_files()
outputspath
indirectly through mapping of GitHub parameter names.format_repo()
(currentlyfile
)peer_assign()
(currentlyfile
)peer_create_issue()
(currentlypath
)peer_return()
(currentlypath
)extract_content()
(currentlyfile
)github_api_repo_get_file
(currentlyfile
)local_path
within functions that reference local filesrepo_add_file()
(currentlyfile
)peer_add_file()
(currentlyfile
)