Do not add covr to Suggests in use_coverage()
#1851
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
At the moment,
use_coverage()
adds covr toSuggests
. This was not always the case but it was added in 2698067, apparently to facilitate coverage computation in travis CI(?).usethis and the R community have now largely moved away from travis in favour of GitHub Actions. The
test-coverage
GHA workflow provided by usethis already installs covr in all cases, without needing it to be explicitly listed inSuggests
.usethis/.github/workflows/test-coverage.yaml
Lines 24 to 27 in e05947f
Homogenizing
This PR proposes to stop automatically including covr in Suggests when running
use_coverage()
(fix #1844). This is in line with whatuse_pkgdown()
does: pkgdown is not added to Suggests there. Again, it's not necessary because as in thetest-coverage
workflow, pkgdown is automatically installed without the need to lDifferences with
use_pkgdown()
use_pkgdown()
does however usecheck_installed("pkgdown")
. I don't believe it's necessary in the case ofuse_coverage()
. The difference is thatuse_pkgdown()
needs to know which pkgdown version is installed to determine the structure of the default_pkgdown.yml
config file.usethis/R/pkgdown.R
Lines 50 to 52 in 00ee947
(Note that
check_installed("pkgdown")
could probably be removed here as well though. It was strictly necessary in the past when usethis used pkgdown functions (87a2cb5) but it's not the case anymore as far as I can tell. Version checking could be done conditionally and the bootstrap 5 template could be used by default when pkgdown is not yet installed. It's a different question though and I can open a separate issue if you wish)