Skip to contents

Format a risk classification

Usage

# S3 method for class 'gptr_risk'
format(x, ...)

# S3 method for class 'gptr_risk'
print(x, ...)

Arguments

x

A gptr_risk object.

...

Unused.

Value

format() returns a character vector: the level line, then one line per flagged call (control, bidi and zero-width characters escaped); print() returns x invisibly.

Examples

r = gptr_risk("x = 1; unlink('data', recursive = TRUE)")
format(r)
#> [1] "risk 3 (dangerous)"                                                     
#> [2] "  [3] file_delete  unlink(\"data\", recursive = TRUE) [path: workspace]"
#> [3] "  creates: x"                                                           
print(r)
#> risk 3 (dangerous)
#>   [3] file_delete  unlink("data", recursive = TRUE) [path: workspace]
#>   creates: x