[ci] [R-package] Add paste_linter (#5320)

[ci] [R-package] Add paste_linter (#5303)
This commit is contained in:
CuriousCorrelation 2022-06-23 03:16:48 +05:30 коммит произвёл GitHub
Родитель feb4cf4f47
Коммит 4b64b173c1
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
7 изменённых файлов: 12 добавлений и 14 удалений

Просмотреть файл

@ -50,6 +50,7 @@ LINTERS_TO_USE <- list(
, "numeric_leading_zero" = lintr::numeric_leading_zero_linter()
, "outer_negation" = lintr::outer_negation_linter()
, "package_hooks" = lintr::package_hooks_linter()
, "paste" = lintr::paste_linter()
, "regex_subset" = lintr::regex_subset_linter()
, "semicolon" = lintr::semicolon_linter()
, "seq" = lintr::seq_linter()

Просмотреть файл

@ -824,7 +824,7 @@ predict.lgb.Booster <- function(object,
}
warning(paste0(
"predict.lgb.Booster: Found the following passed through '...': "
, paste(names(additional_params), collapse = ", ")
, toString(names(additional_params))
, ". These are ignored. Use argument 'params' instead."
))
}
@ -1131,7 +1131,7 @@ lgb.get.eval.result <- function(booster, data_name, eval_name, iters = NULL, is_
"lgb.get.eval.result: data_name "
, shQuote(data_name)
, " not found. Only the following datasets exist in record evals: ["
, paste(data_names, collapse = ", ")
, toString(data_names)
, "]"
))
}
@ -1145,7 +1145,7 @@ lgb.get.eval.result <- function(booster, data_name, eval_name, iters = NULL, is_
, " not found. Only the following eval_names exist for dataset "
, shQuote(data_name)
, ": ["
, paste(eval_names, collapse = ", ")
, toString(eval_names)
, "]"
))
stop("lgb.get.eval.result: wrong eval name")

Просмотреть файл

@ -471,7 +471,7 @@ Dataset <- R6::R6Class(
if (!is.character(field_name) || length(field_name) != 1L || !field_name %in% .INFO_KEYS()) {
stop(
"Dataset$get_field(): field_name must one of the following: "
, paste0(sQuote(.INFO_KEYS()), collapse = ", ")
, toString(sQuote(.INFO_KEYS()))
)
}
@ -523,7 +523,7 @@ Dataset <- R6::R6Class(
if (!is.character(field_name) || length(field_name) != 1L || !field_name %in% .INFO_KEYS()) {
stop(
"Dataset$set_field(): field_name must one of the following: "
, paste0(sQuote(.INFO_KEYS()), collapse = ", ")
, toString(sQuote(.INFO_KEYS()))
)
}

Просмотреть файл

@ -224,9 +224,7 @@ Predictor <- R6::R6Class(
, "dsparseVector"
, "dgRMatrix"
, "dgCMatrix"
, paste(class(data)
, collapse = ", ")))
, toString(class(data))))
}
if (NROW(row.names(data))) {

Просмотреть файл

@ -20,14 +20,13 @@
column_classes <- .get_column_classes(df = df)
unconverted_columns <- column_classes[!(column_classes %in% c("numeric", "integer"))]
if (length(unconverted_columns) > 0L) {
col_detail_string <- paste0(
col_detail_string <- toString(
paste0(
names(unconverted_columns)
, " ("
, unconverted_columns
, ")"
)
, collapse = ", "
)
msg <- paste0(
function_name

Просмотреть файл

@ -437,7 +437,7 @@ test_that("predict() keeps row names from data (binary classification)", {
data(agaricus.train, package = "lightgbm")
X <- as.matrix(agaricus.train$data)
y <- agaricus.train$label
row.names(X) <- paste("rname", seq(1L, nrow(X)), sep = "")
row.names(X) <- paste0("rname", seq(1L, nrow(X)))
dtrain <- lgb.Dataset(X, label = y, params = list(max_bins = 5L))
bst <- lgb.train(
data = dtrain
@ -452,7 +452,7 @@ test_that("predict() keeps row names from data (multi-class classification)", {
data(iris)
y <- as.numeric(iris$Species) - 1.0
X <- as.matrix(iris[, names(iris) != "Species"])
row.names(X) <- paste("rname", seq(1L, nrow(X)), sep = "")
row.names(X) <- paste0("rname", seq(1L, nrow(X)))
dtrain <- lgb.Dataset(X, label = y, params = list(max_bins = 5L))
bst <- lgb.train(
data = dtrain

Просмотреть файл

@ -70,7 +70,7 @@ unrecognized_args <- setdiff(given_args, recognized_args)
if (length(unrecognized_args) > 0L) {
msg <- paste0(
"Unrecognized arguments: "
, paste0(unrecognized_args, collapse = ", ")
, toString(unrecognized_args)
)
stop(msg)
}
@ -417,7 +417,7 @@ c_api_symbols <- gsub(
)
dynlib_statement <- paste0(
"useDynLib(lib_lightgbm, "
, paste0(c_api_symbols, collapse = ", ")
, toString(c_api_symbols)
, ")"
)
namespace_contents[dynlib_line] <- dynlib_statement