Skip to content

Commit

Permalink
use single if-else
Browse files Browse the repository at this point in the history
  • Loading branch information
IndrajeetPatil committed Aug 4, 2024
1 parent b0a2423 commit 63b0017
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions R/methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,15 @@ print.lints <- function(x, ...) {
lapply(x, print, ...)
}

if (isTRUE(settings$error_on_lint)) quit("no", 31L, FALSE) # nocov
}

if (length(x) == 0L) {
cli_inform(c("i" = "No lints found."))
if (use_rstudio_source_markers) rstudio_source_markers(x) # clear RStudio source markers
if (isTRUE(settings$error_on_lint)) {
quit("no", 31L, FALSE) # nocov
}
} else {
# Empty lints
cli_inform(c(i = "No lints found."))
if (use_rstudio_source_markers) {
rstudio_source_markers(x) # clear RStudio source markers
}
}

invisible(x)
Expand Down

0 comments on commit 63b0017

Please sign in to comment.