Skip to content

Commit d04001a

Browse files
use specific imports for rex (#1918)
1 parent 7e6cfcd commit d04001a

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

NAMESPACE

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,12 @@ export(with_defaults)
137137
export(with_id)
138138
export(xml_nodes_to_lints)
139139
export(yoda_test_linter)
140-
import(rex)
141140
importFrom(cyclocomp,cyclocomp)
141+
importFrom(rex,character_class)
142+
importFrom(rex,re_matches)
143+
importFrom(rex,re_substitutes)
144+
importFrom(rex,regex)
145+
importFrom(rex,rex)
142146
importFrom(stats,na.omit)
143147
importFrom(utils,capture.output)
144148
importFrom(utils,getParseData)

R/lintr-package.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"_PACKAGE"
99

1010
## lintr namespace: start
11-
#' @import rex
11+
#' @importFrom rex rex regex re_matches re_substitutes character_class
1212
#' @importFrom stats na.omit
1313
#' @importFrom utils capture.output head getParseData relist
1414
#' @importFrom xml2 xml_find_all as_list

tests/testthat/test-fixed_regex_linter.R

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,14 @@ patrick::with_parameters_test_that(
5959
fixed_regex_linter()
6060
)
6161
},
62-
.cases = data.frame(
63-
char = c(
62+
.cases = local({
63+
char <- c(
6464
"^", "$", "{", "}", "(", ")", ".", "*", "+", "?",
6565
"|", "[", "]", "\\\\", "<", ">", "=", ":", ";", "/",
6666
"_", "-", "!", "@", "#", "%", "&", "~"
67-
),
68-
stringsAsFactors = FALSE
69-
)
67+
)
68+
data.frame(char = char, .test_name = char, stringsAsFactors = FALSE)
69+
})
7070
)
7171

7272
test_that("fixed_regex_linter catches regex like [.] or [$]", {

0 commit comments

Comments
 (0)