@@ -84,33 +84,36 @@ default_linters <- with_defaults(default = list(),
8484
8585# ' Default lintr settings
8686# ' @seealso \code{\link{read_settings}}, \code{\link{default_linters}}
87- default_settings <- list (
88- linters = default_linters ,
89- exclude = rex :: rex(" #" , any_spaces , " nolint" ),
90- exclude_start = rex :: rex(" #" , any_spaces , " nolint start" ),
91- exclude_end = rex :: rex(" #" , any_spaces , " nolint end" ),
92- exclusions = list (),
93- cache_directory = " ~/.R/lintr_cache" , # nolint
94- comment_token = rot(
95- paste0(
96- " 0n12nn72507" ,
97- " r6273qnnp34" ,
98- " 43qno7q42n1" ,
99- " n71nn28" )
100- , 54 - 13 ),
101- comment_bot = logical_env(" LINTR_COMMENT_BOT" ) %|| % TRUE ,
102- error_on_lint = logical_env(" LINTR_ERROR_ON_LINT" ) %|| % FALSE
103- )
87+ default_settings <- NULL
10488
105- settings <- list2env( default_settings , parent = emptyenv())
89+ settings <- NULL
10690
10791.onLoad <- function (libname , pkgname ) { # nolint
10892 op <- options()
10993 op.lintr <- list (
11094 lintr.linter_file = " .lintr"
11195 )
112- toset <- ! (names(op.lintr ) %in% names(op ))
96+ toset <- ! (names(op.lintr ) %in% names(op ))
11397 if (any(toset )) options(op.lintr [toset ])
11498
99+ default_settings <<- list (
100+ linters = default_linters ,
101+ exclude = rex :: rex(" #" , any_spaces , " nolint" ),
102+ exclude_start = rex :: rex(" #" , any_spaces , " nolint start" ),
103+ exclude_end = rex :: rex(" #" , any_spaces , " nolint end" ),
104+ exclusions = list (),
105+ cache_directory = " ~/.R/lintr_cache" , # nolint
106+ comment_token = rot(
107+ paste0(
108+ " 0n12nn72507" ,
109+ " r6273qnnp34" ,
110+ " 43qno7q42n1" ,
111+ " n71nn28" )
112+ , 54 - 13 ),
113+ comment_bot = logical_env(" LINTR_COMMENT_BOT" ) %|| % TRUE ,
114+ error_on_lint = logical_env(" LINTR_ERROR_ON_LINT" ) %|| % FALSE
115+ )
116+
117+ settings <<- list2env(default_settings , parent = emptyenv())
115118 invisible ()
116119}
0 commit comments