diff --git a/R/helpers.R b/R/helpers.R index 06f4c1b..7e0390c 100644 --- a/R/helpers.R +++ b/R/helpers.R @@ -39,3 +39,16 @@ set_rownames = function(vec) { return(vec) } + +# check for empty URLs in a file +check_empty_urls <- function(file_path) { + content <- readLines(file_path) + # Regex to match empty URLs like [text]() + empty_url_pattern <- "\\[.*?\\]\\(\\s*\\)" + + # Look for any lines that match the pattern + empty_urls <- grep(empty_url_pattern, content, value = TRUE) + + # Return all found empty URLs + return(empty_urls) +} diff --git a/README.Rmd b/README.Rmd index 13d3be0..3e4e2f0 100644 --- a/README.Rmd +++ b/README.Rmd @@ -23,7 +23,7 @@ Friendly & Fast Input-Output Analysis `{fio}` (*Friendly Input-Output*) is a R package designed for input-output analysis, emphasizing usability for Excel users and performance. It includes an [RStudio Addin](https://rstudio.github.io/rstudioaddins/) and a suite of functions for straightforward import of input-output tables from Excel, either programmatically or directly from the clipboard. diff --git a/README.md b/README.md index 153860b..12bdd65 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ status](https://www.r-pkg.org/badges/version/fio)](https://CRAN.R-project.org/pa [![R-CMD-check](https://github.com/albersonmiranda/fio/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/albersonmiranda/fio/actions/workflows/R-CMD-check.yaml) [![Codecov test coverage](https://codecov.io/gh/albersonmiranda/fio/branch/main/graph/badge.svg)](https://app.codecov.io/gh/albersonmiranda/fio?branch=main) -[![Downloads](https://cranlogs.r-pkg.org/badges/grand-total/fio)]() +[![Downloads](https://cranlogs.r-pkg.org/badges/grand-total/fio)](https://CRAN.R-project.org/package=fio) `{fio}` (*Friendly Input-Output*) is a R package designed for diff --git a/cran-comments.md b/cran-comments.md index 71cb4c8..56b3186 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -13,6 +13,15 @@ - Fedora 37, 38, 39, 40; R and all dependencies installed from default repository (`dnf install`). * All tests passed successfully, except macOS 13 (R-devel). Transitive dependency `fs` could not be installed due to a compilation error. The error is not related to `fio`. The error is being tracked in the following issue: [Compilation fail macOS 13 (R 4.5)](https://github.com/r-lib/fs/issues/467) +## Resubmission + +This is a resubmission. In this version I have: + +* Fixed empty URL in README.md. +* Added unit test for empty URLs in .Rd, .Rmd and .md files. + +## CRAN requests + In this version I have addressed CRAN requests (e-mail received in 2024-08-23): * Update messages in `msrv.R`: @@ -23,4 +32,4 @@ In this version I have addressed CRAN requests (e-mail received in 2024-08-23): - Evidence: Evidence of the fix can be found in the following CI run: - [GitHub Actions - Rust-check](https://github.com/albersonmiranda/fio/actions/runs/10536150893) - Job `no-install` for evidence that build fails when `cargo` and `rustc` are not found and install instructions are displayed along with the minimum version required. - - Job `msrv-lower` for evidence that build fails when `cargo` and `rustc` are found but the minimum version required is not met and an error message is displayed containing both installed and required Rust versions. \ No newline at end of file + - Job `msrv-lower` for evidence that build fails when `cargo` and `rustc` are found but the minimum version required is not met and an error message is displayed containing both installed and required Rust versions. diff --git a/tests/testthat/test-empty-urls.R b/tests/testthat/test-empty-urls.R new file mode 100644 index 0000000..1dc2af3 --- /dev/null +++ b/tests/testthat/test-empty-urls.R @@ -0,0 +1,16 @@ +# CRAN requires that URLs in the documentation are valid and not empty, including badges +test_that("No empty URLs in markdown files", { + # Specify the path to the package directory + package_path <- file.path(c(".", "man")) # Adjust this if your tests directory is nested + + # Find all documentation files in the package directory + files <- list.files(package_path, pattern = "\\.Rmd$|\\.md$|\\.Rd$", recursive = TRUE, full.names = TRUE) + + # Check each markdown file for empty URLs + for (file in files) { + empty_urls <- check_empty_urls(file) + + # Expect no empty URLs in the file + expect_length(empty_urls, 0) + } +})