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

add 'skipCoverage' option to build library config #215

Merged
merged 2 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .buildlibrary
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ValidationKey: '94312998'
ValidationKey: '9609120'
AutocreateReadme: yes
AcceptedWarnings:
- 'Warning: package ''.*'' was built under R version'
Expand All @@ -8,3 +8,4 @@ AcceptedNotes:
- 'Package suggested but not available for checking: .poorman.'
allowLinterWarnings: no
enforceVersionUpdate: no
skipCoverage: no
2 changes: 1 addition & 1 deletion .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ jobs:
shell: Rscript {0}
run: |
nonDummyTests <- setdiff(list.files("./tests/testthat/"), c("test-dummy.R", "_snaps"))
if(length(nonDummyTests) > 0) covr::codecov(quiet = FALSE)
if(length(nonDummyTests) > 0 && !lucode2:::loadBuildLibraryConfig()[["skipCoverage"]]) covr::codecov(quiet = FALSE)
env:
NOT_CRAN: "true"
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ cff-version: 1.2.0
message: If you use this software, please cite it using the metadata from this file.
type: software
title: 'lucode2: Code Manipulation and Analysis Tools'
version: 0.47.14
date-released: '2024-10-11'
version: 0.48.0
date-released: '2024-10-23'
abstract: A collection of tools which allow to manipulate and analyze code.
authors:
- family-names: Dietrich
Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Type: Package
Package: lucode2
Title: Code Manipulation and Analysis Tools
Version: 0.47.14
Date: 2024-10-11
Version: 0.48.0
Date: 2024-10-23
Authors@R: c(
person("Jan Philipp", "Dietrich", email = "[email protected]",
comment = c(affiliation = "Potsdam Institute for Climate Impact Research", ORCID = "0000-0002-4309-6431"), role = c("aut","cre")),
Expand Down
5 changes: 5 additions & 0 deletions R/buildLibrary.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@
#' (autocompletion via asterisks allowed)
#' * **allowLinterWarnings**: yes/no - If set to "no" linter warnings will stop the build process.
#' (default: yes)
#' * **enforceVersionUpdate**: yes/no - If set to "yes", the version number must
#' be incremented to a non-dev version number
#' for the build process to succeed. (default: no)
#' * **skipCoverage**: yes/no - If set to "yes", running code coverage using covr
#' as part of the GitHub workflow will be skipped. (default: no)
#' @author Jan Philipp Dietrich, Anastasis Giannousakis, Markus Bonsch, Pascal Sauer
#' @seealso \code{\link{package2readme}}, \code{\link{lint}}, \code{\link{autoFormat}}
#' @importFrom desc desc desc_get_deps
Expand Down
2 changes: 1 addition & 1 deletion R/isVersionUpdated.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#' isVersionUpdated
#'
#' Checks if the version number in the DESCRIPTION file of a given package has
#' been updated.
#' been updated (may not be a version number for development stage packages).
#' @param repo package repository to determine latest version
#' @param config A configuration defining enforceVersionUpdate. By default
#' the .buildLibrary file is read.
Expand Down
4 changes: 4 additions & 0 deletions R/loadBuildLibraryConfig.R
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,9 @@ loadBuildLibraryConfig <- function(lib = ".") {
cfg$enforceVersionUpdate <- FALSE
}

if (is.null(cfg$skipCoverage)) {
cfg$skipCoverage <- FALSE
}

return(cfg)
}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Code Manipulation and Analysis Tools

R package **lucode2**, version **0.47.14**
R package **lucode2**, version **0.48.0**

[![CRAN status](https://www.r-pkg.org/badges/version/lucode2)](https://cran.r-project.org/package=lucode2) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4389418.svg)](https://doi.org/10.5281/zenodo.4389418) [![R build status](https://github.com/pik-piam/lucode2/workflows/check/badge.svg)](https://github.com/pik-piam/lucode2/actions) [![codecov](https://codecov.io/gh/pik-piam/lucode2/branch/master/graph/badge.svg)](https://app.codecov.io/gh/pik-piam/lucode2) [![r-universe](https://pik-piam.r-universe.dev/badges/lucode2)](https://pik-piam.r-universe.dev/builds)

Expand Down Expand Up @@ -39,7 +39,7 @@ In case of questions / problems please contact Jan Philipp Dietrich <dietrich@pi

To cite package **lucode2** in publications use:

Dietrich J, Sauer P, Klein D, Giannousakis A, Bonsch M, Bodirsky B, Baumstark L, Richters O, Pflüger M (2024). _lucode2: Code Manipulation and Analysis Tools_. doi:10.5281/zenodo.4389418 <https://doi.org/10.5281/zenodo.4389418>, R package version 0.47.14, <https://github.com/pik-piam/lucode2>.
Dietrich J, Sauer P, Klein D, Giannousakis A, Bonsch M, Bodirsky B, Baumstark L, Richters O, Pflüger M (2024). _lucode2: Code Manipulation and Analysis Tools_. doi:10.5281/zenodo.4389418 <https://doi.org/10.5281/zenodo.4389418>, R package version 0.48.0, <https://github.com/pik-piam/lucode2>.

A BibTeX entry for LaTeX users is

Expand All @@ -48,7 +48,7 @@ A BibTeX entry for LaTeX users is
title = {lucode2: Code Manipulation and Analysis Tools},
author = {Jan Philipp Dietrich and Pascal Sauer and David Klein and Anastasis Giannousakis and Markus Bonsch and Benjamin Leon Bodirsky and Lavinia Baumstark and Oliver Richters and Mika Pflüger},
year = {2024},
note = {R package version 0.47.14},
note = {R package version 0.48.0},
url = {https://github.com/pik-piam/lucode2},
doi = {10.5281/zenodo.4389418},
}
Expand Down
2 changes: 1 addition & 1 deletion inst/extdata/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ jobs:
shell: Rscript {0}
run: |
nonDummyTests <- setdiff(list.files("./tests/testthat/"), c("test-dummy.R", "_snaps"))
if(length(nonDummyTests) > 0) covr::codecov(quiet = FALSE)
if(length(nonDummyTests) > 0 && !lucode2:::loadBuildLibraryConfig()[["skipCoverage"]]) covr::codecov(quiet = FALSE)
pascal-sauer marked this conversation as resolved.
Show resolved Hide resolved
env:
NOT_CRAN: "true"
5 changes: 5 additions & 0 deletions man/buildLibrary.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/isVersionUpdated.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading