@@ -243,11 +243,11 @@ paws_check_pkg_size <- function(
243243 dir_info [,
244244 c(" status" , " percentage" ) : = list (
245245 fcase(
246- get(" size" ) > threshold ,
247- " ERROR" ,
248- get(" size" ) > threshold * .75 ,
249- " WARNING" ,
250- get(" size" ) < = threshold * .75 ,
246+ get(" size" ) > threshold ,
247+ " ERROR" ,
248+ get(" size" ) > threshold * .75 ,
249+ " WARNING" ,
250+ get(" size" ) < = threshold * .75 ,
251251 " OK"
252252 ),
253253 paste(round(as.numeric(get(" size" ) / threshold ) * 100 , 2 ), " %" )
@@ -375,39 +375,22 @@ paws_build_cran_comments <- function(
375375
376376 dir_info [,
377377 " cran_comment" : = fcase(
378- is.na(get(" errors" )) & is.na(get(" warnings" )) & is.na(get(" notes" )),
379- " There were no ERRORs, WARNINGs, or Notes." ,
380- is.na(get(" errors" )) & is.na(get(" warnings" )) & ! is.na(get(" notes" )),
381- sprintf(" There were no ERRORs, or WARNINGs.\n Notes:\n %s" , get(" notes" )),
382- is.na(get(" errors" )) & ! is.na(get(" warnings" )) & ! is.na(get(" notes" )),
383- sprintf(
384- " There were no ERRORs.\n Warnings:%s\n Notes:\n %s" ,
385- get(" warnings" ),
386- get(" notes" )
387- ),
388- is.na(get(" errors" )) & ! is.na(get(" warnings" )) & is.na(get(" notes" )),
389- sprintf(" There were no ERRORs or Notes.\n Warnings:%s" , warnings ),
390- ! is.na(get(" errors" )) & ! is.na(get(" warnings" )) & ! is.na(get(" notes" )),
391- sprintf(
392- " Errors:\n %s\n Warnings:\n %s\n Notes:\n %s" ,
393- get(" errors" ),
394- get(" warnings" ),
395- get(" notes" )
396- ),
397- ! is.na(get(" errors" )) & is.na(get(" warnings" )) & is.na(get(" notes" )),
398- sprintf(" There was no WARNINGS or Notes.\n Errors:\n %s" , get(" errors" )),
399- ! is.na(get(" errors" )) & ! is.na(get(" warnings" )) & is.na(get(" notes" )),
400- sprintf(
401- " There was no WARNINGS.\n Errors:\n %s\n Notes:\n %s" ,
402- get(" errors" ),
403- get(" notes" )
404- ),
405- ! is.na(get(" errors" )) & ! is.na(get(" warnings" )) & ! is.na(get(" notes" )),
406- sprintf(
407- " There was no NOTES.\n Errors:\n %s\n Notes:\n %s" ,
408- get(" errors" ),
409- get(" warnings" )
410- )
378+ is.na(get(" errors" )) & is.na(get(" warnings" )) & is.na(get(" notes" )) ,
379+ " There were no ERRORs, WARNINGs, or Notes." ,
380+ is.na(get(" errors" )) & is.na(get(" warnings" )) & ! is.na(get(" notes" )) ,
381+ sprintf(" There were no ERRORs, or WARNINGs.\n Notes:\n %s" , get(" notes" )) ,
382+ is.na(get(" errors" )) & ! is.na(get(" warnings" )) & ! is.na(get(" notes" )) ,
383+ sprintf(" There were no ERRORs.\n Warnings:%s\n Notes:\n %s" , get(" warnings" ), get(" notes" )) ,
384+ is.na(get(" errors" )) & ! is.na(get(" warnings" )) & is.na(get(" notes" )) ,
385+ sprintf(" There were no ERRORs or Notes.\n Warnings:%s" , warnings ) ,
386+ ! is.na(get(" errors" )) & ! is.na(get(" warnings" )) & ! is.na(get(" notes" )) ,
387+ sprintf(" Errors:\n %s\n Warnings:\n %s\n Notes:\n %s" , get(" errors" ), get(" warnings" ), get(" notes" )) ,
388+ ! is.na(get(" errors" )) & is.na(get(" warnings" )) & is.na(get(" notes" )) ,
389+ sprintf(" There was no WARNINGS or Notes.\n Errors:\n %s" , get(" errors" )) ,
390+ ! is.na(get(" errors" )) & ! is.na(get(" warnings" )) & is.na(get(" notes" )) ,
391+ sprintf(" There was no WARNINGS.\n Errors:\n %s\n Notes:\n %s" , get(" errors" ), get(" notes" )) ,
392+ ! is.na(get(" errors" )) & ! is.na(get(" warnings" )) & ! is.na(get(" notes" )) ,
393+ sprintf(" There was no NOTES.\n Errors:\n %s\n Notes:\n %s" , get(" errors" ), get(" warnings" ))
411394 )
412395 ]
413396
@@ -576,7 +559,9 @@ remove_html_span_r <- function(files) {
576559 result <- readLines(file )
577560 start_idx <- grep(" <span" , result , perl = T )
578561 end_idx <- grep(" </span>" , result , perl = T )
579- if (length(start_idx ) == 0 ) next
562+ if (length(start_idx ) == 0 ) {
563+ next
564+ }
580565 idx_ranges <- lapply(1 : length(start_idx ), \(x ) start_idx [x ]: end_idx [x ])
581566 for (idx_range in idx_ranges ) {
582567 line <- paste(result [idx_range ], collapse = " \n " )
@@ -601,7 +586,9 @@ remove_html_span_rd <- function(files) {
601586 result <- readLines(file )
602587 start_idx <- grep(" <span" , result , perl = T )
603588 end_idx <- grep(" </span>" , result , perl = T )
604- if (length(start_idx ) == 0 ) next
589+ if (length(start_idx ) == 0 ) {
590+ next
591+ }
605592 idx_ranges <- lapply(1 : length(start_idx ), \(x ) start_idx [x ]: end_idx [x ])
606593 for (idx_range in idx_ranges ) {
607594 line <- paste(result [idx_range ], collapse = " \n " )
@@ -703,7 +690,9 @@ list_paws_pkgs <- function(in_dir = "../cran", pkg_list = list()) {
703690 pkgs <- file.path(in_dir , c(" paws" , active_pkgs ))
704691
705692 # filter on pkg list
706- if (any(nzchar(pkg_list ))) pkgs <- pkgs [basename(pkgs ) %in% pkg_list ]
693+ if (any(nzchar(pkg_list ))) {
694+ pkgs <- pkgs [basename(pkgs ) %in% pkg_list ]
695+ }
707696 return (pkgs )
708697}
709698
0 commit comments