11get_exclusions = function () {
2- if (! file.exists(" .lintr" )) return (c(" ^R/|^cache/|^packrat/|^renv/" ))
2+ if (! file.exists(" .lintr" )) {
3+ return (c(" ^R/|^cache/|^packrat/|^renv/" ))
4+ }
35
46 exclusions = read.dcf(" .lintr" , all = TRUE )$ exclusions
57
6- if (is.null(exclusions )) return (c(" ^R/|^cache/|^packrat/|^renv/" ))
8+ if (is.null(exclusions )) {
9+ return (c(" ^R/|^cache/|^packrat/|^renv/" ))
10+ }
711 exclusions = stringr :: str_split(exclusions , " ," )[[1 ]]
812 exclusions = stringr :: str_remove(exclusions , " list\\ W?\\ (" )
913 exclusions = stringr :: str_remove(exclusions , " \\ )$" )
1014 exclusions = stringr :: str_squish(exclusions )
1115 exclusions = stringr :: str_remove_all(exclusions , (" ^\" |\" $" ))
1216
1317 # # Convert to regular expression
14- pattern = paste0(c(exclusions , " ^R/" , " ^cache/" , " ^packrat/" , " ^renv/" ), collapse = " |" )
15- return (pattern )
18+ pattern = paste0(
19+ c(exclusions , " ^R/" , " ^cache/" , " ^packrat/" , " ^renv/" ),
20+ collapse = " |"
21+ )
22+ pattern
1623}
1724
1825lint_files = function () {
1926 lint_errors = FALSE
20- lints = lintr :: lint_package(exclusions = list (" R/RcppExports.R" , " renv" , " packrat" , " cache" ))
27+ lints = lintr :: lint_package(
28+ exclusions = list (" R/RcppExports.R" , " renv" , " packrat" , " cache" )
29+ )
2130 if (length(lints ) > 0 ) {
2231 lapply(lints , print )
2332 lint_errors = TRUE
@@ -34,7 +43,7 @@ lint_files = function() {
3443 }
3544 }
3645
37- return ( lint_errors )
46+ lint_errors
3847}
3948
4049# ' @title The lintr check
@@ -63,5 +72,5 @@ check_lintr = function(path = ".") {
6372 } else {
6473 cli :: cli_alert_success(" Lint looks good" )
6574 }
66- return ( invisible (NULL ) )
75+ invisible (NULL )
6776}
0 commit comments