@@ -208,32 +208,50 @@ text_file_paths_default_regex__ <- function() {
208208text_file_paths_default__ <- function () {
209209 # @codedoc_comment_block codedoc:::text_file_paths_default__
210210 # ```r
211- # dir(
212- # path = getwd(),
213- # pattern = "${text_file_paths_default_regex__()}",
214- # full.names = TRUE,
215- # recursive = TRUE,
216- # ignore.case = TRUE
217- # )
211+ # {
212+ # tfp <- dir(
213+ # path = getwd(),
214+ # pattern = "${text_file_paths_default_regex__()}",
215+ # full.names = TRUE,
216+ # recursive = TRUE,
217+ # ignore.case = TRUE
218+ # )
219+ # tfp <- normalizePath(
220+ # path = tfp,
221+ # winslash = "/",
222+ # mustWork = FALSE
223+ # )
224+ # tfp <- tfp[!grepl("/renv/library/", tfp)]
225+ # }
218226 # ```
219227 # @codedoc_comment_block codedoc:::text_file_paths_default__
220228 # @codedoc_comment_block news("codedoc::extract_keyed_comment_blocks", "2025-03-07", "0.6.0")
221229 # `codedoc::extract_keyed_comment_blocks` default for `text_file_paths`
222230 # expanded: Now uses regex
223231 # `"[.]((r)|(rmd)|(py)|(sql)|(cpp)|(hpp)|(c)|(h))$"` in `dir` call.
224232 # @codedoc_comment_block news("codedoc::extract_keyed_comment_blocks", "2025-03-07", "0.6.0")
225- out <- dir(
226- path = getwd(),
227- pattern = text_file_paths_default_regex__(),
228- full.names = TRUE ,
229- recursive = TRUE ,
230- ignore.case = TRUE
231- )
232- out <- normalizePath(
233- out ,
234- winslash = " /" ,
235- mustWork = TRUE
236- )
233+ # @codedoc_comment_block news("codedoc::extract_keyed_comment_blocks", "2025-04-10", "0.7.0")
234+ # `codedoc::extract_keyed_comment_blocks` default for `text_file_paths`
235+ # improved: It now excludes files under `.../renv/library/` to avoid looking
236+ # through files in installed R packages. That is the typical directory for
237+ # packages installed by package `renv`.
238+ # @codedoc_comment_block news("codedoc::extract_keyed_comment_blocks", "2025-04-10", "0.7.0")
239+ out <- {
240+ tfp <- dir(
241+ path = getwd(),
242+ pattern = text_file_paths_default_regex__(),
243+ full.names = TRUE ,
244+ recursive = TRUE ,
245+ ignore.case = TRUE
246+ )
247+ tfp <- normalizePath(
248+ path = tfp ,
249+ winslash = " /" ,
250+ mustWork = FALSE
251+ )
252+ tfp <- tfp [! grepl(" /renv/library/" , tfp )]
253+ tfp
254+ }
237255 return (out )
238256}
239257
0 commit comments