Skip to content

Commit

Permalink
removed some lint
Browse files Browse the repository at this point in the history
  • Loading branch information
radbasa committed Jan 11, 2024
1 parent 44c458b commit 5b35886
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions R/linter_box_universal_import_linter.R
Original file line number Diff line number Diff line change
Expand Up @@ -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 `...`."
Expand Down
10 changes: 5 additions & 5 deletions tests/testthat/test-linter_box_universal_import_linter.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})

Expand All @@ -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)
})

0 comments on commit 5b35886

Please sign in to comment.