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
15ac2f7b
Unverified
Commit
15ac2f7b
authored
Sep 03, 2024
by
vnherdeiro
Committed by
GitHub
Sep 02, 2024
Browse files
fix some shellcheck warnings (#6621)
Co-authored-by:
James Lamb
<
jaylamb20@gmail.com
>
parent
b1203c97
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
26 additions
and
24 deletions
+26
-24
.ci/check-python-dists.sh
.ci/check-python-dists.sh
+5
-5
.ci/lint-cpp.sh
.ci/lint-cpp.sh
+7
-6
.ci/rerun-workflow.sh
.ci/rerun-workflow.sh
+4
-4
.ci/set-commit-status.sh
.ci/set-commit-status.sh
+2
-2
.ci/trigger-dispatch-run.sh
.ci/trigger-dispatch-run.sh
+3
-3
R-package/recreate-configure.sh
R-package/recreate-configure.sh
+2
-2
docs/build-docs.sh
docs/build-docs.sh
+3
-2
No files found.
.ci/check-python-dists.sh
View file @
15ac2f7b
...
@@ -16,11 +16,11 @@ pip install \
...
@@ -16,11 +16,11 @@ pip install \
twine
||
exit
1
twine
||
exit
1
echo
"twine check..."
echo
"twine check..."
twine check
--strict
${
DIST_DIR
}
/
*
||
exit
1
twine check
--strict
"
$(
echo
"
${
DIST_DIR
}
"
/
*
)
"
||
exit
1
if
{
test
"
${
TASK
}
"
=
"bdist"
||
test
"
${
METHOD
}
"
=
"wheel"
;
}
;
then
if
{
test
"
${
TASK
}
"
=
"bdist"
||
test
"
${
METHOD
}
"
=
"wheel"
;
}
;
then
echo
"check-wheel-contents..."
echo
"check-wheel-contents..."
check-wheel-contents
${
DIST_DIR
}
/
*
.whl
||
exit
1
check-wheel-contents
"
$(
echo
"
${
DIST_DIR
}
"
/
*
.whl
)
"
||
exit
1
fi
fi
PY_MINOR_VER
=
$(
python
-c
"import sys; print(sys.version_info.minor)"
)
PY_MINOR_VER
=
$(
python
-c
"import sys; print(sys.version_info.minor)"
)
...
@@ -34,7 +34,7 @@ if [ "$PY_MINOR_VER" -gt 7 ]; then
...
@@ -34,7 +34,7 @@ if [ "$PY_MINOR_VER" -gt 7 ]; then
--ignore
'distro-too-large-compressed'
\
--ignore
'distro-too-large-compressed'
\
--max-allowed-size-uncompressed
'100M'
\
--max-allowed-size-uncompressed
'100M'
\
--max-allowed-files
800
\
--max-allowed-files
800
\
"
$(
echo
${
DIST_DIR
}
/
*
)
"
||
exit
1
"
$(
echo
"
${
DIST_DIR
}
"
/
*
)
"
||
exit
1
elif
{
test
"
$(
uname
-m
)
"
=
"aarch64"
;
}
;
then
elif
{
test
"
$(
uname
-m
)
"
=
"aarch64"
;
}
;
then
pydistcheck
\
pydistcheck
\
--inspect
\
--inspect
\
...
@@ -42,14 +42,14 @@ if [ "$PY_MINOR_VER" -gt 7 ]; then
...
@@ -42,14 +42,14 @@ if [ "$PY_MINOR_VER" -gt 7 ]; then
--max-allowed-size-compressed
'5M'
\
--max-allowed-size-compressed
'5M'
\
--max-allowed-size-uncompressed
'15M'
\
--max-allowed-size-uncompressed
'15M'
\
--max-allowed-files
800
\
--max-allowed-files
800
\
"
$(
echo
${
DIST_DIR
}
/
*
)
"
||
exit
1
"
$(
echo
"
${
DIST_DIR
}
"
/
*
)
"
||
exit
1
else
else
pydistcheck
\
pydistcheck
\
--inspect
\
--inspect
\
--max-allowed-size-compressed
'5M'
\
--max-allowed-size-compressed
'5M'
\
--max-allowed-size-uncompressed
'15M'
\
--max-allowed-size-uncompressed
'15M'
\
--max-allowed-files
800
\
--max-allowed-files
800
\
"
$(
echo
${
DIST_DIR
}
/
*
)
"
||
exit
1
"
$(
echo
"
${
DIST_DIR
}
"
/
*
)
"
||
exit
1
fi
fi
else
else
echo
"skipping pydistcheck (does not support Python 3.
${
PY_MINOR_VER
}
)"
echo
"skipping pydistcheck (does not support Python 3.
${
PY_MINOR_VER
}
)"
...
...
.ci/lint-cpp.sh
View file @
15ac2f7b
...
@@ -10,14 +10,15 @@ cpplint \
...
@@ -10,14 +10,15 @@ cpplint \
echo
"done running cpplint"
echo
"done running cpplint"
echo
"running cmakelint"
echo
"running cmakelint"
cmake_files
=
$(
find
\
find
.
-name
CMakeLists.txt
-o
-path
"./cmake/*.cmake"
\
.
\
|
grep
-v
external_libs
-type
f
\
)
\(
-name
CMakeLists.txt
-o
-path
"./cmake/*.cmake"
\)
\
cmakelint
\
-not
-path
'./external_libs/*'
\
-exec
cmakelint
\
--linelength
=
120
\
--linelength
=
120
\
--filter
=
-convention
/filename,-package/stdargs,-readability/wonkycase
\
--filter
=
-convention
/filename,-package/stdargs,-readability/wonkycase
\
${
cmake_files
}
\
{}
\+
\
||
exit
1
||
exit
1
echo
"done running cmakelint"
echo
"done running cmakelint"
...
...
.ci/rerun-workflow.sh
View file @
15ac2f7b
...
@@ -35,13 +35,13 @@ runs=$(
...
@@ -35,13 +35,13 @@ runs=$(
"
${
GITHUB_API_URL
}
/repos/microsoft/LightGBM/actions/workflows/
${
workflow_id
}
/runs?event=pull_request&branch=
${
pr_branch
}
"
|
\
"
${
GITHUB_API_URL
}
/repos/microsoft/LightGBM/actions/workflows/
${
workflow_id
}
/runs?event=pull_request&branch=
${
pr_branch
}
"
|
\
jq
'.workflow_runs'
jq
'.workflow_runs'
)
)
runs
=
$(
echo
$
runs
| jq
--arg
pr_number
"
$pr_number
"
--arg
pr_branch
"
$pr_branch
"
'map(select(.event == "pull_request" and ((.pull_requests | length) != 0 and (.pull_requests[0].number | tostring) == $pr_number or .head_branch == $pr_branch)))'
)
runs
=
$(
echo
"
${
runs
}
"
| jq
--arg
pr_number
"
$
{
pr_number
}
"
--arg
pr_branch
"
$
{
pr_branch
}
"
'map(select(.event == "pull_request" and ((.pull_requests | length) != 0 and (.pull_requests[0].number | tostring) == $pr_number or .head_branch == $pr_branch)))'
)
runs
=
$(
echo
$
runs
| jq
'sort_by(.run_number) | reverse'
)
runs
=
$(
echo
"
${
runs
}
"
| jq
'sort_by(.run_number) | reverse'
)
if
[[
$(
echo
$
runs
| jq
'length'
)
-gt
0
]]
;
then
if
[[
$(
echo
"
${
runs
}
"
| jq
'length'
)
-gt
0
]]
;
then
curl
-sL
\
curl
-sL
\
-X
POST
\
-X
POST
\
-H
"Accept: application/vnd.github.v3+json"
\
-H
"Accept: application/vnd.github.v3+json"
\
-H
"Authorization: token
$SECRETS_WORKFLOW
"
\
-H
"Authorization: token
$SECRETS_WORKFLOW
"
\
"
${
GITHUB_API_URL
}
/repos/microsoft/LightGBM/actions/runs/
$(
echo
$
runs
| jq
'.[0].id'
)
/rerun"
"
${
GITHUB_API_URL
}
/repos/microsoft/LightGBM/actions/runs/
$(
echo
"
${
runs
}
"
| jq
'.[0].id'
)
/rerun"
fi
fi
.ci/set-commit-status.sh
View file @
15ac2f7b
...
@@ -39,9 +39,9 @@ sha=$3
...
@@ -39,9 +39,9 @@ sha=$3
data
=
$(
data
=
$(
jq
-n
\
jq
-n
\
--arg
state
$
status
\
--arg
state
"
${
status
}
"
\
--arg
url
"
${
GITHUB_SERVER_URL
}
/microsoft/LightGBM/actions/runs/
${
GITHUB_RUN_ID
}
"
\
--arg
url
"
${
GITHUB_SERVER_URL
}
/microsoft/LightGBM/actions/runs/
${
GITHUB_RUN_ID
}
"
\
--arg
name
"
$name
"
\
--arg
name
"
$
{
name
}
"
\
'{"state":$state,"target_url":$url,"context":$name}'
'{"state":$state,"target_url":$url,"context":$name}'
)
)
...
...
.ci/trigger-dispatch-run.sh
View file @
15ac2f7b
...
@@ -37,9 +37,9 @@ pr=$(
...
@@ -37,9 +37,9 @@ pr=$(
data
=
$(
data
=
$(
jq
-n
\
jq
-n
\
--arg
event_type
"
$dispatch_name
"
\
--arg
event_type
"
$dispatch_name
"
\
--arg
pr_number
"
$(
echo
$pr
| jq
'.number'
)
"
\
--arg
pr_number
"
$(
echo
"
$pr
"
| jq
'.number'
)
"
\
--arg
pr_sha
"
$(
echo
$pr
| jq
'.head.sha'
)
"
\
--arg
pr_sha
"
$(
echo
"
$pr
"
| jq
'.head.sha'
)
"
\
--arg
pr_branch
"
$(
echo
$pr
| jq
'.head.ref'
)
"
\
--arg
pr_branch
"
$(
echo
"
$pr
"
| jq
'.head.ref'
)
"
\
--arg
comment_number
"
$comment_id
"
\
--arg
comment_number
"
$comment_id
"
\
'{"event_type":$event_type,"client_payload":{"pr_number":$pr_number,"pr_sha":$pr_sha,"pr_branch":$pr_branch,"comment_number":$comment_number}}'
'{"event_type":$event_type,"client_payload":{"pr_number":$pr_number,"pr_sha":$pr_sha,"pr_branch":$pr_branch,"comment_number":$comment_number}}'
)
)
...
...
R-package/recreate-configure.sh
View file @
15ac2f7b
...
@@ -8,7 +8,7 @@ AUTOCONF_VERSION=$(cat R-package/AUTOCONF_UBUNTU_VERSION)
...
@@ -8,7 +8,7 @@ AUTOCONF_VERSION=$(cat R-package/AUTOCONF_UBUNTU_VERSION)
# R packages cannot have versions like 3.0.0rc1, but
# R packages cannot have versions like 3.0.0rc1, but
# 3.0.0-1 is acceptable
# 3.0.0-1 is acceptable
LGB_VERSION
=
$(
cat
VERSION.txt |
sed
"s/rc/-/g"
)
LGB_VERSION
=
$(
sed
"s/rc/-/g"
< VERSION.txt
)
# this script changes configure.ac. Copying to a temporary file
# this script changes configure.ac. Copying to a temporary file
# so changes to configure.ac don't get committed in git
# so changes to configure.ac don't get committed in git
...
@@ -20,7 +20,7 @@ apt update
...
@@ -20,7 +20,7 @@ apt update
apt-get
install
\
apt-get
install
\
--no-install-recommends
\
--no-install-recommends
\
-y
\
-y
\
autoconf
=
${
AUTOCONF_VERSION
}
autoconf
=
"
${
AUTOCONF_VERSION
}
"
cd
R-package
cd
R-package
...
...
docs/build-docs.sh
View file @
15ac2f7b
...
@@ -8,10 +8,10 @@ export PATH="${CONDA}/bin:${PATH}"
...
@@ -8,10 +8,10 @@ export PATH="${CONDA}/bin:${PATH}"
curl
\
curl
\
-sL
\
-sL
\
-o
${
HOME
}
/miniforge.sh
\
-o
"
${
HOME
}
/miniforge.sh
"
\
https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh
https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh
/bin/bash
${
HOME
}
/miniforge.sh
-b
-p
${
CONDA
}
/bin/bash
"
${
HOME
}
/miniforge.sh
"
-b
-p
"
${
CONDA
}
"
conda config
--set
always_yes
yes
--set
changeps1 no
conda config
--set
always_yes
yes
--set
changeps1 no
conda update
-q
-y
conda
conda update
-q
-y
conda
...
@@ -20,6 +20,7 @@ conda env create \
...
@@ -20,6 +20,7 @@ conda env create \
--name
docs-env
\
--name
docs-env
\
--file
env.yml
||
exit
1
--file
env.yml
||
exit
1
# shellcheck disable=SC1091
source
activate docs-env
source
activate docs-env
make clean html
||
exit
1
make clean html
||
exit
1
...
...
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