Skip to content

Commit 9977822

Browse files
example linting all rules
1 parent a3234f4 commit 9977822

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/testthat/test-library_call_linter.R

+7-1
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,16 @@ test_that("library_call_linter warns on disallowed usages", {
114114
trim_some("
115115
library(dplyr)
116116
print('test')
117+
suppressMessages(library('lubridate', character.only = TRUE))
117118
suppressMessages(library(tidyr))
118119
print('test')
119120
"),
120-
lint_message,
121+
list(
122+
list(rex::rex("Unify consecutive calls to suppressMessages()"), line_number = 3L),
123+
list(lint_message, line_number = 3L),
124+
list(rex::rex("Use symbols in library calls to avoid the need for 'character.only'"), line_number = 3L),
125+
list(lint_message, line_number = 4L)
126+
),
121127
linter
122128
)
123129
})

0 commit comments

Comments
 (0)