Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tianlh
LightGBM-DCU
Commits
9893867c
Unverified
Commit
9893867c
authored
May 30, 2022
by
James Lamb
Committed by
GitHub
May 30, 2022
Browse files
[R-package] address linter warnings about portable paths (#5249)
parent
59f59c9f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
8 deletions
+9
-8
R-package/inst/make-r-def.R
R-package/inst/make-r-def.R
+1
-1
R-package/src/install.libs.R
R-package/src/install.libs.R
+7
-6
R-package/tests/testthat/test_basic.R
R-package/tests/testthat/test_basic.R
+1
-1
No files found.
R-package/inst/make-r-def.R
View file @
9893867c
...
@@ -71,7 +71,7 @@ invisible(file.remove(OBJDUMP_FILE))
...
@@ -71,7 +71,7 @@ invisible(file.remove(OBJDUMP_FILE))
# see https://www.cs.colorado.edu/~main/cs1300/doc/mingwfaq.html
# see https://www.cs.colorado.edu/~main/cs1300/doc/mingwfaq.html
start_index
<-
which
(
start_index
<-
which
(
grepl
(
grepl
(
pattern
=
"[Ordinal/Name Pointer] Table"
pattern
=
"[Ordinal/Name Pointer] Table"
# nolint
,
x
=
objdump_results
,
x
=
objdump_results
,
fixed
=
TRUE
,
fixed
=
TRUE
)
)
...
...
R-package/src/install.libs.R
View file @
9893867c
...
@@ -23,6 +23,11 @@ if (!(R_int_UUID == "0310d4b8-ccb1-4bb8-ba94-d36a55f60262"
...
@@ -23,6 +23,11 @@ if (!(R_int_UUID == "0310d4b8-ccb1-4bb8-ba94-d36a55f60262"
warning
(
"Warning: unmatched R_INTERNALS_UUID, may not run normally."
)
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
# system() will not raise an R exception if the process called
# fails. Wrapping it here to get that behavior.
# fails. Wrapping it here to get that behavior.
#
#
...
@@ -96,7 +101,7 @@ if (!(R_int_UUID == "0310d4b8-ccb1-4bb8-ba94-d36a55f60262"
...
@@ -96,7 +101,7 @@ if (!(R_int_UUID == "0310d4b8-ccb1-4bb8-ba94-d36a55f60262"
# Move in CMakeLists.txt
# Move in CMakeLists.txt
write_succeeded
<-
file.copy
(
write_succeeded
<-
file.copy
(
"../inst/bin/
CMakeLists.txt"
file.path
(
inst_dir
,
"bin"
,
"
CMakeLists.txt"
)
,
"CMakeLists.txt"
,
"CMakeLists.txt"
,
overwrite
=
TRUE
,
overwrite
=
TRUE
)
)
...
@@ -104,10 +109,6 @@ if (!write_succeeded) {
...
@@ -104,10 +109,6 @@ if (!write_succeeded) {
stop
(
"Copying CMakeLists.txt failed"
)
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
# Prepare building package
dir.create
(
dir.create
(
build_dir
build_dir
...
@@ -122,7 +123,7 @@ use_visual_studio <- !(use_mingw || use_msys2)
...
@@ -122,7 +123,7 @@ use_visual_studio <- !(use_mingw || use_msys2)
# to create R.def from R.dll
# to create R.def from R.dll
if
(
WINDOWS
&&
use_visual_studio
)
{
if
(
WINDOWS
&&
use_visual_studio
)
{
write_succeeded
<-
file.copy
(
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"
)
,
file.path
(
build_dir
,
"make-r-def.R"
)
,
overwrite
=
TRUE
,
overwrite
=
TRUE
)
)
...
...
R-package/tests/testthat/test_basic.R
View file @
9893867c
...
@@ -2429,7 +2429,7 @@ test_that("lgb.train() fit on linearly-relatead data improves when using linear
...
@@ -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() w
ith
linear learner fails already-constructed dataset with linear=false"
,
{
set.seed
(
708L
)
set.seed
(
708L
)
params
<-
list
(
params
<-
list
(
objective
=
"regression"
objective
=
"regression"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment