Skip to content

Commit

Permalink
use specific imports for rex
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelChirico committed Feb 25, 2023
1 parent c69f792 commit 98a6962
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
6 changes: 5 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,12 @@ export(with_defaults)
export(with_id)
export(xml_nodes_to_lints)
export(yoda_test_linter)
import(rex)
importFrom(cyclocomp,cyclocomp)
importFrom(rex,character_class)
importFrom(rex,re_matches)
importFrom(rex,re_substitutes)
importFrom(rex,regex)
importFrom(rex,rex)
importFrom(stats,na.omit)
importFrom(utils,capture.output)
importFrom(utils,getParseData)
Expand Down
2 changes: 1 addition & 1 deletion R/lintr-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"_PACKAGE"

## lintr namespace: start
#' @import rex
#' @importFrom rex rex regex re_matches re_substitutes character_class
#' @importFrom stats na.omit
#' @importFrom utils capture.output head getParseData relist
#' @importFrom xml2 xml_find_all as_list
Expand Down
10 changes: 5 additions & 5 deletions tests/testthat/test-fixed_regex_linter.R
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ patrick::with_parameters_test_that(
fixed_regex_linter()
)
},
.cases = data.frame(
char = c(
.cases = local({
char <- c(
"^", "$", "{", "}", "(", ")", ".", "*", "+", "?",
"|", "[", "]", "\\\\", "<", ">", "=", ":", ";", "/",
"_", "-", "!", "@", "#", "%", "&", "~"
),
stringsAsFactors = FALSE
)
)
data.frame(char = char, .test_name = char, stringsAsFactors = FALSE)
})
)

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

0 comments on commit 98a6962

Please sign in to comment.