From 18e9dd866addf2c4168a007260fb6b0a99843738 Mon Sep 17 00:00:00 2001 From: Joshua Lambert Date: Thu, 28 Mar 2024 11:13:35 +0000 Subject: [PATCH] linting and updated .lintr to exclude some undesirable function lintrs --- .lintr | 4 +++- R/extract_param.R | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.lintr b/.lintr index c5c32d8c9..5f69e9d88 100644 --- a/.lintr +++ b/.lintr @@ -9,7 +9,9 @@ linters: all_linters( modify_defaults( default_undesirable_functions, citEntry = "use the more modern bibentry() function", - library = NULL # too many false positive in too many files + library = NULL, # too many false positive in too many files + structure = NULL, # used for class constructor functions + par = NULL # used with on.exit() and {withrs} is not a dependency ) ), function_argument_linter = NULL, diff --git a/R/extract_param.R b/R/extract_param.R index abd1e3514..965cb0fd8 100644 --- a/R/extract_param.R +++ b/R/extract_param.R @@ -119,11 +119,11 @@ extract_param <- function(type = c("percentiles", "range"), # Validate inputs switch(type, - "percentiles" = stopifnot( # nolint + percentiles = stopifnot( # nolint "'values' and 'percentiles' need to be a vector of length 2" = type == "percentiles" && length(values) == 2 || length(percentiles) == 2 ), - "range" = stopifnot( + range = stopifnot( "'values need to be a vector of length 3" = type == "range" && length(values) == 3 )