File tree Expand file tree Collapse file tree 4 files changed +6
-22
lines changed Expand file tree Collapse file tree 4 files changed +6
-22
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ open_config(root = here::here())
1111open_wordlist(root = here::here())
1212path_pre_commit_exec(check_if_exists = TRUE)
1313path_precommit_exec(check_if_exists = TRUE)
14+ precommit_docopt(doc, args = commandArgs(trailingOnly = TRUE), ...)
1415robust_purl(path)
1516roxygen_assert_additional_dependencies()
1617roxygenize_with_cache(key, dirs)
Original file line number Diff line number Diff line change @@ -149,7 +149,7 @@ hook_state_create <- function(tempdir,
149149
150150 # quote any individual filenames with spaces so the shell identifies them
151151 # each as a single term
152- files <- ifelse( grepl( ' ' , files ), shQuote(files ), files )
152+ files <- shQuote(files )
153153
154154 system2(paste0(Sys.getenv(" R_HOME" ), " /bin/Rscript" ),
155155 args = as.character(c(path_executable , cmd_args , files )),
Original file line number Diff line number Diff line change @@ -89,14 +89,14 @@ git_init <- function(path = ".") {
8989# ' than an array/vector, and so this function wraps docopt
9090# ' to
9191# '
92- # ' @param doc \code{ character} vector with command line specification
93- # ' @param args \code{ character} vector of commandline arguments.
94- # ' Defaults to \code{ commandArgs(trailingOnly=TRUE)} .
92+ # ' @param doc ` character` vector with command line specification
93+ # ' @param args ` character` vector of commandline arguments.
94+ # ' Defaults to ` commandArgs(trailingOnly=TRUE)` .
9595# ' @param ... Additional parameters passed to `docopt`
9696# ' @family hook script helpers
9797# ' @keywords internal
9898# ' @export
99- precommit_docopt <- function (doc , args = commandArgs(trailingOnly = TRUE ), ... ) {
99+ precommit_docopt <- function (doc , args = commandArgs(trailingOnly = TRUE ), ... ) {
100100 docopt :: docopt(doc , c(args , " " ), ... )
101101}
102102
Original file line number Diff line number Diff line change @@ -232,23 +232,6 @@ run_test(
232232)
233233
234234
235- # verify that functions that use docopt without arguments function as
236- # expected with filenames that contain spaces
237-
238- run_test(" parsable-R" ,
239- file_name = " parsable R with spaces" ,
240- suffix = " -success.R" ,
241- std_err = NULL
242- )
243-
244- run_test(" parsable-R" ,
245- file_name = " parsable R with spaces" ,
246- suffix = " -fail.R" ,
247- std_out = " Full context" ,
248- std_err = " 1 1"
249- )
250-
251-
252235# ## . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..
253236# ## spell-check ####
254237# success
You can’t perform that action at this time.
0 commit comments