diff --git a/R/scan-deps.R b/R/scan-deps.R index e841869d..5e814222 100644 --- a/R/scan-deps.R +++ b/R/scan-deps.R @@ -109,6 +109,8 @@ scan_deps_pattern <- function() { "[.]r$", "[.]Rmd$", "[.]rmd$", + "[.]rmarkdown", + "[.]Rmarkdown", "[.]qmd$", "^_bookdown[.]yml$", "^_quarto[.]yml$", @@ -261,6 +263,7 @@ scan_path_deps_do <- function(code, path) { ext, ".r" = scan_path_deps_do_r(code, path), ".qmd" = , + ".rmarkdown" = , ".rmd" = scan_path_deps_do_rmd(code, path), "DESCRIPTION" = scan_path_deps_do_dsc(code, path), "NAMESPACE" = scan_path_deps_do_namespace(code, path), diff --git a/tests/testthat/_snaps/unix/scan-deps.md b/tests/testthat/_snaps/unix/scan-deps.md index 1b718566..b8be090f 100644 --- a/tests/testthat/_snaps/unix/scan-deps.md +++ b/tests/testthat/_snaps/unix/scan-deps.md @@ -3,15 +3,17 @@ Code scan_deps(project)[] Output - # A data frame: 6 x 9 - path ref package version type code start_row start_column start_byte - - 1 R/code.R CD CD * prod CD::pkg 4 1 26 - 2 R/code.R AB AB * prod library(AB) 1 1 1 - 3 R/code.R BC BC * prod require(BC) 2 1 13 - 4 doc.qmd pkgload pkgload * prod pkgload::load_all 12 1 174 - 5 index.Rmd ST ST * prod ST::fun 10 1 97 - 6 index.Rmd RS RS * prod library(RS) 9 1 85 + # A data frame: 8 x 9 + path ref package version type code start_row start_column start_byte + + 1 R/code.R CD CD * prod CD::pkg 4 1 26 + 2 R/code.R AB AB * prod library(AB) 1 1 1 + 3 R/code.R BC BC * prod require(BC) 2 1 13 + 4 doc.qmd pkgload pkgload * prod pkgload::load_all 12 1 174 + 5 index.Rmarkdown ST ST * prod ST::fun 10 1 97 + 6 index.Rmarkdown RS RS * prod library(RS) 9 1 85 + 7 index.Rmd ST ST * prod ST::fun 10 1 97 + 8 index.Rmd RS RS * prod library(RS) 9 1 85 --- @@ -23,8 +25,8 @@ + AB @ R/code.R + BC @ R/code.R + CD @ R/code.R - + RS @ index.Rmd - + ST @ index.Rmd + + RS @ index.Rmarkdown, index.Rmd + + ST @ index.Rmarkdown, index.Rmd + pkgload @ doc.qmd # scan_path_deps diff --git a/tests/testthat/fixtures/scan/project-1/index.Rmarkdown b/tests/testthat/fixtures/scan/project-1/index.Rmarkdown new file mode 100644 index 00000000..87205409 --- /dev/null +++ b/tests/testthat/fixtures/scan/project-1/index.Rmarkdown @@ -0,0 +1,11 @@ +--- +title: pkgdepends +output: + github_document: +always_allow_html: yes +--- + +```{r} +library(RS) +ST::fun() +```