Skip to content

Commit

Permalink
remove lint
Browse files Browse the repository at this point in the history
  • Loading branch information
radbasa committed Jan 12, 2024
1 parent 442d96f commit df3e02d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions R/linter_box_separate_packages_modules.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#' Box library separate packages and module imports linter
#'
#'
#' Checks that packages and modules are imported in separate `box::use()` statements.
#'
#'
#' @examples
#' # will produce lints
#' lintr::lint(
Expand All @@ -13,7 +13,7 @@
#' text = "box::use(path/to/file, package)",
#' linters = box_separate_calls_linter()
#' )
#'
#'
#' # okay
#' lintr::lint(
#' text = "box::use(package1, package2)
Expand All @@ -32,7 +32,7 @@ box_separate_calls_linter <- function() {
]
"
lint_message <- "Separate packages and modules in their respective box::use() calls."

lintr::Linter(function(source_expression) {
if (!lintr::is_lint_level(source_expression, "file")) {
return(list())
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-linter_box_separate_packages_modules.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ lint_message <- rex::rex("Separate packages and modules in their respective box:

test_that("box_separate_calls_linter skips allowed box::use() calls", {
linter <- box_separate_calls_linter()

lintr::expect_lint(good_box_calls, NULL, linter)
})

test_that("box_separate_calls_linter blocks packages and modules in same box::use() call", {
linter <- box_separate_calls_linter()

lintr::expect_lint(bad_box_call_1, list(message = lint_message), linter)
lintr::expect_lint(bad_box_call_2, list(message = lint_message), linter)
})

0 comments on commit df3e02d

Please sign in to comment.