Skip to content

Commit 6616f6b

Browse files
committed
feat: improve text_file_paths_default__
1 parent 1ccf6e1 commit 6616f6b

File tree

4 files changed

+74
-27
lines changed

4 files changed

+74
-27
lines changed

NEWS.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
<!-- generated by R package codedoc; do not modify! -->
22

3+
## News for version 0.7.0
4+
5+
### codedoc::extract_keyed_comment_blocks
6+
7+
`codedoc::extract_keyed_comment_blocks` default for `text_file_paths`
8+
improved: It now excludes files under `.../renv/library/` to avoid looking
9+
through files in installed R packages. That is the typical directory for
10+
packages installed by package `renv`.
11+
12+
313
## News for version 0.6.3
414

515
### codedoc::extract_keyed_comment_blocks

R/collect_raw.R

Lines changed: 37 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -208,32 +208,50 @@ text_file_paths_default_regex__ <- function() {
208208
text_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

man/codedoc-package.Rd

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/extract_keyed_comment_blocks.Rd

Lines changed: 16 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)