Skip to content

Commit

Permalink
lintr: revert to disable object_usage
Browse files Browse the repository at this point in the history
  • Loading branch information
averissimo committed Feb 29, 2024
1 parent b7c294b commit ba5b9ef
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions .lintr
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
linters: linters_with_defaults(
line_length_linter(120),
object_usage linter = NULL,
object_name_linter = object_name_linter(
styles = c("snake_case", "symbols"),
regexes = c(
Expand Down
4 changes: 2 additions & 2 deletions R/messages.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ var_names_log <- function(tidy_names_df, verbose) {
)

# Message regarding number of variables that were renamed/ modified
num_renamed <- nrow(only_renames) # nolint: object_usage.
tot_num_vars <- nrow(tidy_names_df) # nolint: object_usage.
num_renamed <- nrow(only_renames)
tot_num_vars <- nrow(tidy_names_df)

cli_h2(glue(
.sep = " ",
Expand Down
10 changes: 5 additions & 5 deletions R/utils-xportr.R
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ encode_vals <- function(x) {
#' @return String of text to append error message
#' @noRd
fmt_vars <- function(x) {
vars <- ntext(length(x), "Variable", "Variables") # nolint: object_usage.
vars <- ntext(length(x), "Variable", "Variables")
glue("{vars} {encode_vars(x)}")
}

Expand All @@ -88,8 +88,8 @@ fmt_vars <- function(x) {
#' @return String of text to append error message
#' @noRd
fmt_labs <- function(x) {
labs <- ntext(length(x), "Label", "Labels") # nolint: object_usage.
val <- paste0(names(x), "=", unname(x)) # nolint: object_usage.
labs <- ntext(length(x), "Label", "Labels")
val <- paste0(names(x), "=", unname(x))
glue("{labs} {encode_vals(val)}")
}

Expand All @@ -100,7 +100,7 @@ fmt_labs <- function(x) {
#' @return String of text to append error message
#' @noRd
fmt_fmts <- function(x) {
fmts <- ntext(length(x), "Format", "Formats") # nolint: object_usage.
fmts <- ntext(length(x), "Format", "Formats")
glue("{fmts} {encode_vals(x)}")
}

Expand Down Expand Up @@ -415,7 +415,7 @@ check_metadata <- function(metadata, include_fun_message, null.ok = FALSE) { # n
return(TRUE)
}

extra_string <- ", 'Metacore' or set via 'xportr_metadata()'" # nolint: object_usage.
extra_string <- ", 'Metacore' or set via 'xportr_metadata()'"
if (!include_fun_message) {
extra_string <- " or 'Metacore'"
}
Expand Down

0 comments on commit ba5b9ef

Please sign in to comment.