Skip to contents

Render the validation errors recorded in the output of validate_config() or validate_hub_config() as an HTML report using only the markup GitHub displays in a pull request comment or job summary. The report is built from tabulate_config_val_errors() and shows the same errors as view_config_val_errors().

Usage

render_config_val_errors_html(x, max_bytes = Inf)

Arguments

x

output of validate_config() or validate_hub_config().

max_bytes

maximum size of the returned HTML in bytes. Rows are dropped from the end of the table until the report fits, and a note below the table gives the number dropped. GitHub rejects a pull request comment over 65,536 characters.

Value

A single string of HTML, or NULL if no errors were detected. The report consists of a paragraph naming the validated path and the schema version, followed by a table with one row per error. The attribute omitted holds the number of error rows dropped to fit max_bytes.

Examples

if (FALSE) { # \dontrun{
config_path <- system.file("error-schema/tasks-errors.json",
  package = "hubUtils"
)
validate_config(config_path = config_path, config = "tasks") |>
  render_config_val_errors_html() |>
  cat()
} # }