Function that scores the lintr output as a percentage per message type (style, warning, error). Lintr messages / lines assessed * 100

darwinLintScore(lintFunction, ...)

Arguments

lintFunction

Lint function to use

...

Other parameters a Lint function might need (i.e. file name)

Value

A tibble of percentage scores per type of Lint message.

Examples

# With darwin file lintr
darwinLintScore(
  lintFunction = darwinLintFile,
  system.file(package = "DependencyReviewer", "testScript.R")
)
#>  style: 3.06% of lines of code have linting messages
#>  warning: 7.14% of lines of code have linting messages
#> # A tibble: 2 × 2
#>   type      pct
#>   <chr>   <dbl>
#> 1 style    3.06
#> 2 warning  7.14

# With standard package lintr
darwinLintScore(
  lintFunction = lintr::lint_package,
  system.file(package = "DependencyReviewer")
)
#>  0 Lintr messages found
#> # A tibble: 0 × 2
#> # … with 2 variables: type <chr>, pct <dbl>