R/show_diagnostic_results.R

Defines functions diagnostic_schema show_diagnostic_results

show_diagnostic_results <- function(results, diagnostic) {
  messagef('Found %d %s:', nrow(results), attr(diagnostic, "diagnostic_tag"))

  for (ii in seq_len(nrow(results))) {
    results[ii, cat(gettextf(
      '\nProblematic call:\n%s\n< File:%s, Line:%s >\n%s',
      call_color(call),
      file_color(file),
      file_color(line_number),
      if (is.na(replacement)) '' else gettextf('Potential replacement:\n%s\n', replacement_color(replacement))
    ))]
  }
}

diagnostic_schema = function() {
  data.table(
    call = character(),
    file = character(),
    line_number = integer(),
    replacement = character()
  )
}

Try the potools package in your browser

Any scripts or data that you put into this service are public.

potools documentation built on Nov. 2, 2023, 5:20 p.m.