Skip to content

Commit fc4e494

Browse files
authored
Reformat code with air (#586)
All straightforward.
1 parent 1fca39e commit fc4e494

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+690
-345
lines changed

.Rbuildignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,5 @@
2121
^LICENSE\.md$
2222
^\.github$
2323
^CRAN-SUBMISSION$
24+
^[.]?air[.]toml$
25+
^\.vscode$

.vscode/extensions.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"recommendations": [
3+
"Posit.air-vscode"
4+
]
5+
}

.vscode/settings.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"[r]": {
3+
"editor.formatOnSave": true,
4+
"editor.defaultFormatter": "Posit.air-vscode"
5+
},
6+
"[quarto]": {
7+
"editor.formatOnSave": true,
8+
"editor.defaultFormatter": "quarto.quarto"
9+
}
10+
}

R/compat-obj-type.R

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
# - Added documentation.
3838
# - Added changelog.
3939

40-
4140
#' Return English-friendly type
4241
#' @param x Any R object.
4342
#' @param value Whether to describe the value of `x`. Special values
@@ -73,12 +72,11 @@ obj_type_friendly <- function(x, value = TRUE) {
7372
typeof(x),
7473
logical = "`NA`",
7574
integer = "an integer `NA`",
76-
double =
77-
if (is.nan(x)) {
78-
"`NaN`"
79-
} else {
80-
"a numeric `NA`"
81-
},
75+
double = if (is.nan(x)) {
76+
"`NaN`"
77+
} else {
78+
"a numeric `NA`"
79+
},
8280
complex = "a complex `NA`",
8381
character = "a character `NA`",
8482
.rlang_stop_unexpected_typeof(x)
@@ -280,14 +278,16 @@ obj_type_oo <- function(x) {
280278
#' @param ... Arguments passed to [abort()].
281279
#' @inheritParams args_error_context
282280
#' @noRd
283-
stop_input_type <- function(x,
284-
what,
285-
...,
286-
allow_na = FALSE,
287-
allow_null = FALSE,
288-
show_value = TRUE,
289-
arg = caller_arg(x),
290-
call = caller_env()) {
281+
stop_input_type <- function(
282+
x,
283+
what,
284+
...,
285+
allow_na = FALSE,
286+
allow_null = FALSE,
287+
show_value = TRUE,
288+
arg = caller_arg(x),
289+
call = caller_env()
290+
) {
291291
# From compat-cli.R
292292
cli <- env_get_list(
293293
nms = c("format_arg", "format_code"),

R/compat-purrr.R

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,16 @@ args_recycle <- function(args) {
9090
}
9191
pmap <- function(.l, .f, ...) {
9292
args <- args_recycle(.l)
93-
do.call("mapply", c(
94-
FUN = list(quote(.f)),
95-
args, MoreArgs = quote(list(...)),
96-
SIMPLIFY = FALSE, USE.NAMES = FALSE
97-
))
93+
do.call(
94+
"mapply",
95+
c(
96+
FUN = list(quote(.f)),
97+
args,
98+
MoreArgs = quote(list(...)),
99+
SIMPLIFY = FALSE,
100+
USE.NAMES = FALSE
101+
)
102+
)
98103
}
99104

100105
probe <- function(.x, .p, ...) {
@@ -200,5 +205,4 @@ vec_index <- function(x) {
200205
names(x) %||% seq_along(x)
201206
}
202207

203-
204208
# nocov end

0 commit comments

Comments
 (0)