Skip to content

Commit

Permalink
Merge pull request #60 from ropensci/reside-383
Browse files Browse the repository at this point in the history
Fix lint
  • Loading branch information
richfitz authored Feb 7, 2025
2 parents 90b4a19 + be55cf4 commit 047d0c7
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
4 changes: 3 additions & 1 deletion .lintr
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
linters: with_defaults(
linters: linters_with_defaults(
indentation_linter = NULL,
object_length_linter = NULL,
object_usage_linter = NULL,
cyclocomp_linter = NULL
)
Expand Down
5 changes: 3 additions & 2 deletions R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -595,8 +595,9 @@ data_load_request <- function(path_data, hash = NULL, quiet = FALSE) {
} else {
stop("Invalid type for 'hash'")
}
names(keys) <- vapply(keys, function(x)
bin2str(data_key_fingerprint(x$pub, version), ""), character(1))
names(keys) <- vapply(keys, function(x) {
bin2str(data_key_fingerprint(x$pub, version), "")
}, character(1))
class(keys) <- "data_keys"
attr(keys, "version") <- version
}
Expand Down
17 changes: 10 additions & 7 deletions tests/testthat/test-util.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ test_that("sys_which", {

test_that("get_password_str", {
testthat::with_mocked_bindings(
get_pass = function(prompt)
if (grepl("Verify", prompt)) "a" else "b", {
expect_error(get_password_str(TRUE, "password"),
"Passwords do not match")
expect_equal(get_password_str(FALSE, "password"),
"b")
})
get_pass = function(prompt) {
if (grepl("Verify", prompt)) "a" else "b"
},
{
expect_error(get_password_str(TRUE, "password"),
"Passwords do not match")
expect_equal(get_password_str(FALSE, "password"),
"b")
}
)

testthat::with_mocked_bindings(
get_pass = function(prompt) "a", {
Expand Down
5 changes: 3 additions & 2 deletions tests/testthat/test-zzz-data.R
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,9 @@ test_that("migrate", {
keys_new <- data_admin_list_keys(path_data)
reqs_new <- data_admin_list_requests(path_data)

map <- vapply(keys_old, function(k)
bin2str(data_key_fingerprint(k$pub, data_schema_version()), ""), "")
map <- vapply(keys_old, function(k) {
bin2str(data_key_fingerprint(k$pub, data_schema_version()), "")
}, "")

expect_setequal(names(keys_new), unname(map))
v <- c("user", "host", "date", "pub", "key")
Expand Down

0 comments on commit 047d0c7

Please sign in to comment.