Unverified Commit 9893867c authored by James Lamb's avatar James Lamb Committed by GitHub
Browse files

[R-package] address linter warnings about portable paths (#5249)

parent 59f59c9f
......@@ -71,7 +71,7 @@ invisible(file.remove(OBJDUMP_FILE))
# see https://www.cs.colorado.edu/~main/cs1300/doc/mingwfaq.html
start_index <- which(
grepl(
pattern = "[Ordinal/Name Pointer] Table"
pattern = "[Ordinal/Name Pointer] Table" # nolint
, x = objdump_results
, fixed = TRUE
)
......
......@@ -23,6 +23,11 @@ if (!(R_int_UUID == "0310d4b8-ccb1-4bb8-ba94-d36a55f60262"
warning("Warning: unmatched R_INTERNALS_UUID, may not run normally.")
}
# Get some paths
source_dir <- file.path(R_PACKAGE_SOURCE, "src", fsep = "/")
build_dir <- file.path(source_dir, "build", fsep = "/")
inst_dir <- file.path(R_PACKAGE_SOURCE, "inst", fsep = "/")
# system() will not raise an R exception if the process called
# fails. Wrapping it here to get that behavior.
#
......@@ -96,7 +101,7 @@ if (!(R_int_UUID == "0310d4b8-ccb1-4bb8-ba94-d36a55f60262"
# Move in CMakeLists.txt
write_succeeded <- file.copy(
"../inst/bin/CMakeLists.txt"
file.path(inst_dir, "bin", "CMakeLists.txt")
, "CMakeLists.txt"
, overwrite = TRUE
)
......@@ -104,10 +109,6 @@ if (!write_succeeded) {
stop("Copying CMakeLists.txt failed")
}
# Get some paths
source_dir <- file.path(R_PACKAGE_SOURCE, "src", fsep = "/")
build_dir <- file.path(source_dir, "build", fsep = "/")
# Prepare building package
dir.create(
build_dir
......@@ -122,7 +123,7 @@ use_visual_studio <- !(use_mingw || use_msys2)
# to create R.def from R.dll
if (WINDOWS && use_visual_studio) {
write_succeeded <- file.copy(
"../../inst/make-r-def.R"
file.path(inst_dir, "make-r-def.R")
, file.path(build_dir, "make-r-def.R")
, overwrite = TRUE
)
......
......@@ -2429,7 +2429,7 @@ test_that("lgb.train() fit on linearly-relatead data improves when using linear
})
test_that("lgb.train() w/ linear learner fails already-constructed dataset with linear=false", {
test_that("lgb.train() with linear learner fails already-constructed dataset with linear=false", {
set.seed(708L)
params <- list(
objective = "regression"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment