diff --git a/R/cyclocomp_linter.R b/R/cyclocomp_linter.R index 2079b41e9..2e5d8ce49 100644 --- a/R/cyclocomp_linter.R +++ b/R/cyclocomp_linter.R @@ -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())