Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions R/cyclocomp_linter.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ cyclocomp_linter <- function(complexity_limit = 15L) {
"Cyclocomp complexity is computed using {.fn cyclocomp::cyclocomp}.",
i = "Please install the needed {.pkg cyclocomp} package."
))
return(Linter(function(.) cli_abort("cyclocomp_linter is disabled due to lack of the {.pkg cyclocomp} package")))
return(Linter(\(.) cli_abort("cyclocomp_linter is disabled due to lack of the {.pkg cyclocomp} package")))
}
# nocov end
Linter(linter_level = "expression", function(source_expression) {
complexity <- try_silently(
cyclocomp::cyclocomp(parse(text = source_expression$content))
cyclocomp::cyclocomp(parse(text = source_expression$content, keep.source = FALSE))
)
if (inherits(complexity, "try-error") || complexity <= complexity_limit) {
return(list())
Expand Down
Loading