Skip to content

Commit 9aa221b

Browse files
Fix some lints (#2048)
* Fix some lints * revert expect_named
1 parent a225a21 commit 9aa221b

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed

R/data.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ get_objs_from_dots <- function(.dots) {
9292
}
9393

9494
is_name <- vapply(.dots, is.symbol, logical(1))
95-
if (any(!is_name)) {
95+
if (!all(is_name)) {
9696
ui_abort("Can only save existing named objects.")
9797
}
9898

R/proj-desc.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ proj_desc_field_update <- function(key, value, overwrite = TRUE, append = FALSE)
4141
return(invisible())
4242
}
4343

44-
if (!overwrite && length(old > 0) && any(old != "")) {
44+
if (!overwrite && length(old) > 0 && any(old != "")) {
4545
ui_abort("
4646
{.field {key}} has a different value in DESCRIPTION.
4747
Use {.code overwrite = TRUE} to overwrite.")

R/use_standalone.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ as_version_info_row <- function(field, error_call = caller_env()) {
247247

248248
ver <- strsplit(ver, " ")[[1]]
249249

250-
if (!is_character(ver, n = 2) || any(is.na(ver)) || !all(nzchar(ver))) {
250+
if (!is_character(ver, n = 2) || anyNA(ver) || !all(nzchar(ver))) {
251251
cli::cli_abort(
252252
c(
253253
"Can't parse version `{field}` in `imports:` field.",

R/utils-git.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ git_user_get <- function(where = c("de_facto", "local", "global")) {
8383

8484
# translate from "usethis" terminology to "git" terminology
8585
where_from_scope <- function(scope = c("user", "project")) {
86-
scope = match.arg(scope)
86+
scope <- match.arg(scope)
8787

8888
where_scope <- c(user = "global", project = "de_facto")
8989

R/utils-github.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ github_remotes <- function(these = c("origin", "upstream"),
193193
# 1. Did we call the GitHub API? Means we know `is_fork` and the parent repo.
194194
# 2. If so, did we call it with auth? Means we know if we can push.
195195
grl$github_got <- map_lgl(repo_info, ~ length(.x) > 0)
196-
if (isTRUE(github_get) && any(!grl$github_got)) {
196+
if (isTRUE(github_get) && !all(grl$github_got)) {
197197
oops <- which(!grl$github_got)
198198
oops_remotes <- grl$remote[oops]
199199
oops_hosts <- unique(grl$host[oops])

tests/manual/manual-use-github.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ expect_match(desc::desc_get_field("BugReports"), BugReports)
5959

6060
# remove the GitHub links
6161
desc::desc_del(c("BugReports", "URL"))
62-
expect_true(all(!desc::desc_has_fields(c("BugReports", "URL"))))
62+
expect_true(!any(desc::desc_has_fields(c("BugReports", "URL"))))
6363

6464
# restore the GitHub links
6565
# should see a warning that `host` is deprecated and ignored

tests/testthat/test-proj.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,12 @@ test_that("with_project() runs code in temp proj, restores (lack of) proj", {
148148
)
149149

150150
proj_set_(NULL)
151-
expect_identical(proj_get_(), NULL)
151+
expect_null(proj_get_())
152152

153153
res <- with_project(path = temp_proj, proj_get_())
154154

155155
expect_identical(res, temp_proj)
156-
expect_identical(proj_get_(), NULL)
156+
expect_null(proj_get_())
157157
})
158158

159159
test_that("with_project() runs code in temp proj, restores original proj", {

0 commit comments

Comments
 (0)