Skip to content

Commit 10945c2

Browse files
error if cyclocomp is not installed
1 parent 46a11d2 commit 10945c2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

R/cyclocomp_linter.R

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@
2222
#' @seealso [linters] for a complete list of linters available in lintr.
2323
#' @export
2424
cyclocomp_linter <- function(complexity_limit = 15L) {
25+
# nocov start
26+
if (!requireNamespace("cyclocomp", quietly = TRUE)) {
27+
cli::cli_abort("'cyclocomp' package needs to be installed for this linter.")
28+
}
29+
# nocov end
30+
2531
Linter(linter_level = "expression", function(source_expression) {
2632
complexity <- try_silently(
2733
cyclocomp::cyclocomp(parse(text = source_expression$content))

0 commit comments

Comments
 (0)