Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

covr ignores .covrignore file #538

Closed
mpadge opened this issue Sep 5, 2023 · 1 comment
Closed

covr ignores .covrignore file #538

mpadge opened this issue Sep 5, 2023 · 1 comment

Comments

@mpadge
Copy link
Contributor

mpadge commented Sep 5, 2023

In almost any environment (e.g. rocker/tidyverse container), direct call of package_coverage ignores .covignore, while calling via withr does not:

cd /home/
git clone https://github.com/HaoZeke/fastMatMR # A repo with a `.covrignore` file
R
> path <- "/home/fastMatMR"
> c1 <- covr::package_coverage()
> c2 <- withr::with_dir(path, covr::package_coverage())

Result: c1 ignores .covrignore, and gives low coverage, while c2 respects it and gives much higher.

@mpadge
Copy link
Contributor Author

mpadge commented Sep 5, 2023

This happens because these lines presume call is made in root directory:

covr/R/exclusions.R

Lines 210 to 213 in caed186

if (!file.exists(file)) {
return(NULL)
}
lines <- readLines(file)

but that of course need not necessarily be so. Need to fix that function so that file is a full path.

mpadge added a commit to mpadge/covr that referenced this issue Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant