From 5b358868b5fea3d728d83b9f7e8633987f01d168 Mon Sep 17 00:00:00 2001 From: Rodrigo Basa Date: Thu, 11 Jan 2024 12:19:55 +0800 Subject: [PATCH] removed some lint --- R/linter_box_universal_import_linter.R | 10 +++++----- .../testthat/test-linter_box_universal_import_linter.R | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/R/linter_box_universal_import_linter.R b/R/linter_box_universal_import_linter.R index a6982836..e0c04555 100644 --- a/R/linter_box_universal_import_linter.R +++ b/R/linter_box_universal_import_linter.R @@ -8,23 +8,23 @@ #' text = "box::use(base[...])", #' linters = box_universal_import_linter() #' ) -#' +#' #' lintr::lint( #' text = "box::use(path/to/file[...])", #' linters = box_universal_import_linter() #' ) -#' -#' # okay +#' +#' # okay #' lintr::lint( #' text = "box::use(base[print])", #' linters = box_universal_import_linter() #' ) -#' +#' #' lintr::lint( #' text = "box::use(path/to/file[do_something])", #' linters = box_universal_import_linter() #' ) -#' +#' #' @export box_universal_import_linter <- function() { lint_message <- "Explicitly declare imports rather than universally import with `...`." diff --git a/tests/testthat/test-linter_box_universal_import_linter.R b/tests/testthat/test-linter_box_universal_import_linter.R index aa1e08a3..06b30f4d 100644 --- a/tests/testthat/test-linter_box_universal_import_linter.R +++ b/tests/testthat/test-linter_box_universal_import_linter.R @@ -36,19 +36,19 @@ lint_msg <- rex::rex("Explicitly declare imports rather than universally import test_that("box_universal_count_linter skips allowed package import usage", { linter <- box_universal_import_linter() - + lintr::expect_lint(good_package_imports, NULL, linter) }) test_that("box_universal_count_linter skips allowed module import usage", { linter <- box_universal_import_linter() - + lintr::expect_lint(good_module_imports, NULL, linter) }) test_that("box_universal_count_linter blocks disallowed package import usage", { linter <- box_universal_import_linter() - + lintr::expect_lint(bad_package_imports, list(message = lint_msg), linter) }) @@ -60,12 +60,12 @@ test_that("box_universal_count_linter blocks disallowed module import usage", { test_that("box_universal_count_linter skips three dots in function declarations and calls", { linter <- box_universal_import_linter() - + lintr::expect_lint(function_with_three_dots, NULL, linter) }) test_that("box_universal_count_linter respects #nolint", { linter <- box_universal_import_linter() - + lintr::expect_lint(no_lint, NULL, linter) })