Closed KevCaz closed 2 years ago
Merging #17 (1bc7d50) into main (5742681) will not change coverage. The diff coverage is
100.00%
.
@@ Coverage Diff @@
## main #17 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 11 12 +1
Lines 388 393 +5
=========================================
+ Hits 388 393 +5
Impacted Files | Coverage Δ | |
---|---|---|
R/checks.R | 100.00% <100.00%> (ø) |
|
R/fb_format_sites_locations.R | 100.00% <100.00%> (ø) |
|
R/zzz.R | 100.00% <100.00%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update e3122d3...1bc7d50. Read the comment docs.
Damn! I am currently working on the same functions but quite differently. For instance, I have written this kind of functions:
is_of_class <- function(x, y) {
if (!inherits(x, y)) {
stop("Argument '", deparse(substitute(x)), "' must be of class '",
paste0(y, collapse = ", "), "'", call. = FALSE)
}
invisible(NULL)
}
and,
has_na <- function(x) {
if (any(is.na(x))) {
stop("Argument '", deparse(substitute(x)), "' cannot contain NA",
call. = FALSE)
}
invisible(NULL)
}
Thx for this contribution, but we changed the code and this PR is no more needed.
I introduce
stop_condition()
function to reduce code redundancy, it replaced the following code chunk that is used frequentlyI thought it would be easier to wrap this in a function, so we can easily change the way we do our stop messages, e.g. to customize the console message (color, icons, etc). So far I've only changed the code in
R/checks.R
.