Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .lintr
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ linters: all_linters(
object_usage_linter = NULL,
implicit_assignment_linter = NULL,
object_length_linter = NULL,
return_linter = NULL,
namespace_linter = NULL,
unreachable_code_linter = NULL,
cyclocomp_linter(25),
Expand Down
1 change: 0 additions & 1 deletion .lintr_restrictive
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ linters: all_linters(
object_usage_linter = NULL,
implicit_assignment_linter = NULL,
object_length_linter = NULL,
return_linter = NULL,
namespace_linter = NULL,
unreachable_code_linter = NULL,
cyclocomp_linter(25),
Expand Down
4 changes: 2 additions & 2 deletions R/JSON.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ tfrmt_to_json <- function(tfrmt, path = NULL) {
message(paste0("Writing json file out to:\n", path))
write(output, path)
} else {
return(output)
output
}
}

Expand Down Expand Up @@ -94,7 +94,7 @@ as_json.quosure <- function(x) {
out <- x %>%
rlang::as_label()
if (out != "<empty>") {
return(out)
out
}
}

Expand Down
2 changes: 1 addition & 1 deletion R/apply_col_style_plan.R
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ apply_col_style_plan <- function(

force(.data)

return(.data)
.data
}

# function to get all columns the col_style_structure applies to
Expand Down
2 changes: 1 addition & 1 deletion R/apply_row_grp_plan.R
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ fill_post_space <- function(post_space, fill, width) {
fill_val <- stringr::str_sub(post_space, 1, width) # truncate to data width if needed
}

return(fill_val)
fill_val
}


Expand Down
20 changes: 10 additions & 10 deletions R/col_plan.R
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,15 @@ check_span_structure_dots <- function(x) {
~ lapply(trim_vars_quo_c(.x), function(x) {
if (is.name(x)) {
if (identical(rlang::as_label(x), "<empty>")) {
return(NULL)
return(NULL) # nolint: return_linter
} else {
return(rlang::quo(!!x))
return(rlang::quo(!!x)) # nolint: return_linter
}
} else if (is.call(x)) {
if (is_valid_tidyselect_call(x)) {
rlang::quo(!!x)
} else if (is_valid_quo_call(x)) {
return(rlang::eval_tidy(x))
return(rlang::eval_tidy(x)) # nolint: return_linter
} else {
rlang::abort(
message = paste0(
Expand All @@ -188,7 +188,7 @@ check_span_structure_dots <- function(x) {
)
}
} else if (is.character(x)) {
return(as_length_one_quo.character(x))
return(as_length_one_quo.character(x)) # nolint: return_linter
} else {
rlang::abort(
"Unexpected entry type in span_structure()",
Expand All @@ -210,7 +210,7 @@ is_valid_tidyselect_call <- function(x) {
if (as.character(as.list(x)[[1]]) == "-") {
x <- x[[-1]]
if (is.name(x)) {
return(TRUE)
return(TRUE) # nolint: return_linter
}
}
as.character(as.list(x)[[1]]) %in% c(names(tidyselect::vars_select_helpers))
Expand All @@ -221,7 +221,7 @@ is_valid_quo_call <- function(x) {
if (as.character(as.list(x)[[1]]) == "-") {
x <- x[[-1]]
if (is.name(x)) {
return(TRUE)
return(TRUE) # nolint: return_linter
}
}
as.character(as.list(x)[[1]]) %in% c("vars", "quo")
Expand All @@ -231,17 +231,17 @@ check_col_plan_dots <- function(x) {
lapply(x, function(x) {
if (is.name(x)) {
if (identical(rlang::as_label(x), "<empty>")) {
return(NULL)
return(NULL) # nolint: return_linter
} else {
return(rlang::quo(!!x))
return(rlang::quo(!!x)) # nolint: return_linter
}
} else if (is.call(x)) {
if (is_valid_tidyselect_call(x)) {
rlang::quo(!!x)
} else if (
is_valid_quo_call(x) || is_valid_span_structure_call(x)
) {
return(rlang::eval_tidy(x))
return(rlang::eval_tidy(x)) # nolint: return_linter
} else {
stop(
"Invalid entry: `",
Expand All @@ -256,7 +256,7 @@ check_col_plan_dots <- function(x) {
)
}
} else if (is.character(x)) {
return(as_length_one_quo.character(x))
return(as_length_one_quo.character(x)) # nolint: return_linter
} else {
stop("Unexpected entry type in span_structure()")
}
Expand Down
2 changes: 1 addition & 1 deletion R/extract_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,6 @@ extract_data <- function(x, col_delim = "_") {
)
)

return(extracted_list)
extracted_list
}
}
15 changes: 8 additions & 7 deletions R/tfrmt.R
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,11 @@ check_tfrmt <- function(
) {
if (!missing(tfrmt)) {
if (is_tfrmt(tfrmt)) {
return(invisible(NULL))
return(invisible(NULL)) # nolint: return_linter
}

if (allow_null && is.null(tfrmt)) {
return(invisible(NULL))
return(invisible(NULL)) # nolint: return_linter
}
}

Expand Down Expand Up @@ -307,12 +307,12 @@ quo_get <- function(

if (missing(arg_call)) {
## args not defined can quietly return empty expressions.
return(quote(expr = ))
return(quote(expr = )) # nolint: return_linter
} else {
if (
identical(arg_call, rlang::quo()) || identical(arg_call, vars())
) {
return(arg_call)
return(arg_call) # nolint: return_linter
}

# don't try to eval quosures if it is intended to be a quosure
Expand Down Expand Up @@ -346,9 +346,10 @@ quo_get <- function(
is_basic_list(arg_call_results$result))
) {
if (arg %in% as_var_args) {
return(as_vars(arg_call_results$result))
return(as_vars(arg_call_results$result)) # nolint: return_linter
} else {
return(
# nolint: return_linter
as_length_one_quo(
arg_call_results$result,
arg = as.character(arg)
Expand All @@ -358,7 +359,7 @@ quo_get <- function(
}
} else {
## return value as normal if not a var or quo arg
return(arg_call_results$result)
return(arg_call_results$result) # nolint: return_linter
}
}

Expand Down Expand Up @@ -392,7 +393,7 @@ quo_get <- function(
)
}

return(arg_val)
return(arg_val) # nolint: return_linter
} else {
rlang::abort(
paste0(
Expand Down
2 changes: 1 addition & 1 deletion R/tfrmt_layer.R
Original file line number Diff line number Diff line change
Expand Up @@ -354,5 +354,5 @@ reset_component <- function(tfrmt_obj, component_name) {
tfrmt_obj[[component_name]] <- NULL

# Return the modified tfrmt object
return(tfrmt_obj)
tfrmt_obj
}
Loading