Skip to content

Commit

Permalink
review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelChirico authored Dec 6, 2023
1 parent 8961e37 commit ed21a08
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion R/duplicate_argument_linter.R
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ duplicate_argument_linter <- function(except = c("mutate", "transmute")) {
xml_nodes_to_lints(
unlist(all_arg_nodes, recursive = FALSE)[unlist(is_duplicated)],
source_expression = source_expression,
lint_message = "Remove duplicate arguments in function call.",
lint_message = "Avoid duplicate arguments in function calls.",
type = "warning"
)
})
Expand Down
2 changes: 1 addition & 1 deletion R/namespace_linter.R
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ build_ns_get_int_lints <- function(packages, symbols, symbol_nodes, namespaces,
symbol_nodes[exported],
source_expression = source_expression,
lint_message =
sprintf("Use %2$s::%1$s, not %2$s:::%1$s.", symbols[exported], packages[exported]),
sprintf("Don't use `:::` to access %s, which is exported from %s.", symbols[exported], packages[exported]),
type = "warning"
)

Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-duplicate_argument_linter.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ test_that("duplicate_argument_linter doesn't block allowed usages", {

test_that("duplicate_argument_linter blocks disallowed usages", {
linter <- duplicate_argument_linter()
lint_msg <- rex::rex("Remove duplicate arguments in function call.")
lint_msg <- rex::rex("Avoid duplicate arguments in function calls.")

expect_lint("fun(arg = 1, arg = 2)", lint_msg, linter)
expect_lint("fun(arg = 1, 'arg' = 2)", lint_msg, linter)
Expand Down Expand Up @@ -51,7 +51,7 @@ test_that("duplicate_argument_linter respects except argument", {
"fun(`
` = 1, `
` = 2)",
rex::rex("Remove duplicate arguments in function call."),
rex::rex("Avoid duplicate arguments in function calls."),
duplicate_argument_linter(except = character())
)

Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-namespace_linter.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ test_that("namespace_linter blocks disallowed usages", {

expect_lint(
"stats:::sd(c(1,2,3))",
rex::rex("Use stats::sd, not stats:::sd"),
rex::rex("Don't use `:::` to access sd, which is exported from stats."),
linter
)

Expand Down

0 comments on commit ed21a08

Please sign in to comment.