Skip to content

Commit

Permalink
Trial fix req validation (#277)
Browse files Browse the repository at this point in the history
Consistency checks failed:
- requirement #0.17 'Make row layout summary data frames for use during
pagination' is not covered by any test
  • Loading branch information
Melkiades committed Apr 15, 2024
1 parent df6567c commit 40addb0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
21 changes: 11 additions & 10 deletions R/generics.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
### sufficient for hooking that class up to the `formatters` pagination and rendering
### machinery.

## nocov start
#' Make row layout summary data frames for use during pagination
#'
#' All relevant information about table rows (e.g. indentations) is summarized in a `data.frame`.
Expand Down Expand Up @@ -46,6 +45,11 @@
#' both `make_row_df` and `make_col_df` (see [rtables::make_col_df()]), as it is simply the
#' row/column structure of `tt` and thus not useful for pathing or pagination.
#'
#' @examples
#' # Expected error with matrix_form. For real case examples consult {rtables} documentation
#' mf <- basic_matrix_form(iris)
#' # make_row_df(mf) # Use table obj instead
#'
#' @export
#' @name make_row_df
setGeneric("make_row_df", function(tt, colwidths = NULL, visible_only = TRUE,
Expand All @@ -72,12 +76,12 @@ setMethod("make_row_df", "MatrixPrintForm", function(tt, colwidths = NULL, visib
sibpos = NA_integer_,
nsibs = NA_integer_,
max_width = NULL) {
stop(
msg <- paste0(
"make_row_df can be used only on {rtables} table objects, and not on `matrix_form`-",
"generated objects (MatrixPrintForm)."
)
stop(msg)
})
## nocov end

#' Transform `rtable` to a list of matrices which can be used for outputting
#'
Expand Down Expand Up @@ -220,7 +224,7 @@ setMethod("nlines", "character", function(x, colwidths, max_width) {
setGeneric("toString", function(x, ...) standardGeneric("toString"))

## preserve S3 behavior
setMethod("toString", "ANY", base::toString) ## nocov
setMethod("toString", "ANY", base::toString)

#' Print
#'
Expand All @@ -229,7 +233,7 @@ setMethod("toString", "ANY", base::toString) ## nocov
#' @inheritParams base::print
#'
#' @rdname basemethods
setMethod("print", "ANY", base::print) ## nocov
setMethod("print", "ANY", base::print)

# General/"universal" property getter and setter generics and stubs --------------------------------------

Expand All @@ -248,14 +252,11 @@ setMethod("print", "ANY", base::print) ## nocov

# obj_name ---------------------------------------------------------------

## no exported methods so we do nocov
# nocov start
setGeneric("obj_name", function(obj) standardGeneric("obj_name"))

#' @rdname lab_name
#' @export
setGeneric("obj_name<-", function(obj, value) standardGeneric("obj_name<-"))
# nocov end

# obj_label ---------------------------------------------------------------

Expand Down Expand Up @@ -420,7 +421,7 @@ setMethod(

#' @export
#' @rdname title_footer
setGeneric("subtitles", function(obj) standardGeneric("subtitles")) ## nocov
setGeneric("subtitles", function(obj) standardGeneric("subtitles"))

#' @export
#' @rdname title_footer
Expand All @@ -431,7 +432,7 @@ setMethod(

##' @rdname title_footer
##' @export
setGeneric("subtitles<-", function(obj, value) standardGeneric("subtitles<-")) ## nocov
setGeneric("subtitles<-", function(obj, value) standardGeneric("subtitles<-"))

##' @rdname title_footer
##' @export
Expand Down
6 changes: 6 additions & 0 deletions man/make_row_df.Rd

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

0 comments on commit 40addb0

Please sign in to comment.