Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: [ci] include lightgbm's dependencies in linting job #5746

Closed
wants to merge 6 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .ci/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ if [[ $TASK == "swig" ]]; then
fi

if [[ $TASK == "lint" ]]; then
# including lightgbm's dependencies to improve the ability of type checkers like mypy to find bugs
# (excluding plotting dependencies because those cause conflicts in conda solves)
LIGHTGBM_DEPS="dask-core datatable distributed numpy pandas psutil scikit-learn scipy"
cd ${BUILD_DIRECTORY}
conda create -q -y -n $CONDA_ENV \
${CONDA_PYTHON_REQUIREMENT} \
Expand All @@ -75,9 +78,10 @@ if [[ $TASK == "lint" ]]; then
isort \
mypy \
pydocstyle \
"r-lintr>=3.0"
"r-lintr>=3.0" || exit -1
source activate $CONDA_ENV
echo "Linting Python code"
pip install ${LIGHTGBM_DEPS}
sh ${BUILD_DIRECTORY}/.ci/lint-python.sh || exit -1
echo "Linting R code"
Rscript ${BUILD_DIRECTORY}/.ci/lint_r_code.R ${BUILD_DIRECTORY} || exit -1
Expand Down