
Render validation errors as an HTML report for GitHub
Source:R/render_config_val_errors_html.R
render_config_val_errors_html.RdRender 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().
Arguments
- x
output of
validate_config()orvalidate_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.
See also
tabulate_config_val_errors(), view_config_val_errors()
Other functions supporting config file validation:
tabulate_config_val_errors(),
validate_config(),
validate_hub_config(),
view_config_val_errors()
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()
} # }