diff --git a/.appveyor.yml b/.appveyor.yml index 5082729fb..3819447db 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -39,4 +39,4 @@ test_script: - conda config --add channels conda-forge - conda config --set channel_priority strict - conda init powershell - - powershell.exe -ExecutionPolicy Bypass -File %APPVEYOR_BUILD_FOLDER%\.ci\test_windows.ps1 + - powershell.exe -ExecutionPolicy Bypass -File %APPVEYOR_BUILD_FOLDER%\.ci\test-windows.ps1 diff --git a/.ci/append_comment.sh b/.ci/append-comment.sh similarity index 96% rename from .ci/append_comment.sh rename to .ci/append-comment.sh index d10d1a07e..2b2728906 100755 --- a/.ci/append_comment.sh +++ b/.ci/append-comment.sh @@ -4,7 +4,7 @@ # Update comment appending a given body to the specified original comment. # # [usage] -# append_comment.sh +# append-comment.sh # # COMMENT_ID: ID of comment that should be modified. # diff --git a/helpers/check_dynamic_dependencies.py b/.ci/check-dynamic-dependencies.py similarity index 100% rename from helpers/check_dynamic_dependencies.py rename to .ci/check-dynamic-dependencies.py diff --git a/.ci/check_python_dists.sh b/.ci/check-python-dists.sh similarity index 100% rename from .ci/check_python_dists.sh rename to .ci/check-python-dists.sh diff --git a/.nuget/create_nuget.py b/.ci/create-nuget.py similarity index 100% rename from .nuget/create_nuget.py rename to .ci/create-nuget.py diff --git a/.ci/get_workflow_status.py b/.ci/get-workflow-status.py similarity index 98% rename from .ci/get_workflow_status.py rename to .ci/get-workflow-status.py index 875345c2e..1838b18cc 100644 --- a/.ci/get_workflow_status.py +++ b/.ci/get-workflow-status.py @@ -2,7 +2,7 @@ """Get the most recent status of workflow for the current PR. [usage] - python get_workflow_status.py TRIGGER_PHRASE + python get-workflow-status.py TRIGGER_PHRASE TRIGGER_PHRASE: Code phrase that triggers workflow. """ diff --git a/.ci/install_opencl.ps1 b/.ci/install-opencl.ps1 similarity index 100% rename from .ci/install_opencl.ps1 rename to .ci/install-opencl.ps1 diff --git a/.ci/lint_r_code.R b/.ci/lint-r-code.R similarity index 100% rename from .ci/lint_r_code.R rename to .ci/lint-r-code.R diff --git a/helpers/parameter_generator.py b/.ci/parameter-generator.py similarity index 99% rename from helpers/parameter_generator.py rename to .ci/parameter-generator.py index 15db36da2..cb51baa8a 100644 --- a/helpers/parameter_generator.py +++ b/.ci/parameter-generator.py @@ -286,7 +286,7 @@ def gen_parameter_code( * Licensed under the MIT License. See LICENSE file in the project root for license information. * * \note - * This file is auto generated by LightGBM\helpers\parameter_generator.py from LightGBM\include\LightGBM\config.h file. + * This file is auto generated by LightGBM\.ci\parameter-generator.py from LightGBM\include\LightGBM\config.h file. */ """ str_to_write += "#include\nnamespace LightGBM {\n" diff --git a/.ci/rerun_workflow.sh b/.ci/rerun-workflow.sh similarity index 95% rename from .ci/rerun_workflow.sh rename to .ci/rerun-workflow.sh index 98c89137d..757bfdab9 100755 --- a/.ci/rerun_workflow.sh +++ b/.ci/rerun-workflow.sh @@ -4,7 +4,7 @@ # Rerun specified workflow for given pull request. # # [usage] -# rerun_workflow.sh +# rerun-workflow.sh # # WORKFLOW_ID: Identifier (config name of ID) of a workflow to be rerun. # diff --git a/.ci/set_commit_status.sh b/.ci/set-commit-status.sh similarity index 95% rename from .ci/set_commit_status.sh rename to .ci/set-commit-status.sh index c51816144..8682d35e5 100755 --- a/.ci/set_commit_status.sh +++ b/.ci/set-commit-status.sh @@ -4,7 +4,7 @@ # Set a status with a given name to the specified commit. # # [usage] -# set_commit_status.sh +# set-commit-status.sh # # NAME: Name of status. # Status with existing name overwrites a previous one. diff --git a/.ci/test_r_package_valgrind.sh b/.ci/test-r-package-valgrind.sh similarity index 100% rename from .ci/test_r_package_valgrind.sh rename to .ci/test-r-package-valgrind.sh diff --git a/.ci/test_r_package_windows.ps1 b/.ci/test-r-package-windows.ps1 similarity index 100% rename from .ci/test_r_package_windows.ps1 rename to .ci/test-r-package-windows.ps1 diff --git a/.ci/test_r_package.sh b/.ci/test-r-package.sh similarity index 100% rename from .ci/test_r_package.sh rename to .ci/test-r-package.sh diff --git a/.ci/test_windows.ps1 b/.ci/test-windows.ps1 similarity index 97% rename from .ci/test_windows.ps1 rename to .ci/test-windows.ps1 index 5dcd59c28..955fd685c 100644 --- a/.ci/test_windows.ps1 +++ b/.ci/test-windows.ps1 @@ -17,7 +17,7 @@ Remove-Item $env:TMPDIR -Force -Recurse -ErrorAction Ignore [Void][System.IO.Directory]::CreateDirectory($env:TMPDIR) if ($env:TASK -eq "r-package") { - & .\.ci\test_r_package_windows.ps1 ; Check-Output $? + & .\.ci\test-r-package-windows.ps1 ; Check-Output $? Exit 0 } @@ -77,7 +77,7 @@ if ($env:TASK -eq "regular") { } elseif ($env:TASK -eq "sdist") { sh ./build-python.sh sdist ; Check-Output $? - sh ./.ci/check_python_dists.sh ./dist ; Check-Output $? + sh ./.ci/check-python-dists.sh ./dist ; Check-Output $? cd dist; pip install @(Get-ChildItem *.gz) -v ; Check-Output $? } elseif ($env:TASK -eq "bdist") { @@ -92,7 +92,7 @@ elseif ($env:TASK -eq "bdist") { conda activate $env:CONDA_ENV sh "build-python.sh" bdist_wheel --integrated-opencl ; Check-Output $? - sh ./.ci/check_python_dists.sh ./dist ; Check-Output $? + sh ./.ci/check-python-dists.sh ./dist ; Check-Output $? cd dist; pip install @(Get-ChildItem *py3-none-win_amd64.whl) ; Check-Output $? cp @(Get-ChildItem *py3-none-win_amd64.whl) $env:BUILD_ARTIFACTSTAGINGDIRECTORY } elseif (($env:APPVEYOR -eq "true") -and ($env:TASK -eq "python")) { diff --git a/.ci/test.sh b/.ci/test.sh index 4247854fe..7ed9ded32 100755 --- a/.ci/test.sh +++ b/.ci/test.sh @@ -43,7 +43,7 @@ else fi if [[ "${TASK}" == "r-package" ]] || [[ "${TASK}" == "r-rchk" ]]; then - bash "${BUILD_DIRECTORY}/.ci/test_r_package.sh" || exit 1 + bash "${BUILD_DIRECTORY}/.ci/test-r-package.sh" || exit 1 exit 0 fi @@ -86,7 +86,7 @@ if [[ $TASK == "swig" ]]; then if [[ $OS_NAME == "linux" ]] && [[ $COMPILER == "gcc" ]]; then objdump -T ./lib_lightgbm.so > ./objdump.log || exit 1 objdump -T ./lib_lightgbm_swig.so >> ./objdump.log || exit 1 - python ./helpers/check_dynamic_dependencies.py ./objdump.log || exit 1 + python ./.ci/check-dynamic-dependencies.py ./objdump.log || exit 1 fi if [[ $PRODUCES_ARTIFACTS == "true" ]]; then cp ./build/lightgbmlib.jar $BUILD_ARTIFACTSTAGINGDIRECTORY/lightgbmlib_$OS_NAME.jar @@ -108,7 +108,7 @@ if [[ $TASK == "lint" ]]; then echo "Linting Python code" bash ./.ci/lint-python.sh || exit 1 echo "Linting R code" - Rscript ./.ci/lint_r_code.R "${BUILD_DIRECTORY}" || exit 1 + Rscript ./.ci/lint-r-code.R "${BUILD_DIRECTORY}" || exit 1 echo "Linting C++ code" bash ./.ci/lint-cpp.sh || exit 1 exit 0 @@ -143,7 +143,7 @@ if [[ $TASK == "check-docs" ]] || [[ $TASK == "check-links" ]]; then cd "${BUILD_DIRECTORY}" cp ./docs/Parameters.rst ./docs/Parameters-backup.rst cp ./src/io/config_auto.cpp ./src/io/config_auto-backup.cpp - python ./helpers/parameter_generator.py || exit 1 + python ./.ci/parameter-generator.py || exit 1 diff ./docs/Parameters-backup.rst ./docs/Parameters.rst || exit 1 diff ./src/io/config_auto-backup.cpp ./src/io/config_auto.cpp || exit 1 exit 0 @@ -170,7 +170,7 @@ cd "${BUILD_DIRECTORY}" if [[ $TASK == "sdist" ]]; then sh ./build-python.sh sdist || exit 1 - sh .ci/check_python_dists.sh ./dist || exit 1 + sh .ci/check-python-dists.sh ./dist || exit 1 pip install ./dist/lightgbm-$LGB_VER.tar.gz -v || exit 1 if [[ $PRODUCES_ARTIFACTS == "true" ]]; then cp ./dist/lightgbm-$LGB_VER.tar.gz $BUILD_ARTIFACTSTAGINGDIRECTORY || exit 1 @@ -180,7 +180,7 @@ if [[ $TASK == "sdist" ]]; then elif [[ $TASK == "bdist" ]]; then if [[ $OS_NAME == "macos" ]]; then sh ./build-python.sh bdist_wheel || exit 1 - sh .ci/check_python_dists.sh ./dist || exit 1 + sh .ci/check-python-dists.sh ./dist || exit 1 if [[ $PRODUCES_ARTIFACTS == "true" ]]; then cp dist/lightgbm-$LGB_VER-py3-none-macosx*.whl $BUILD_ARTIFACTSTAGINGDIRECTORY || exit 1 fi @@ -199,7 +199,7 @@ elif [[ $TASK == "bdist" ]]; then mv \ ./dist/tmp.whl \ ./dist/lightgbm-$LGB_VER-py3-none-$PLATFORM.whl || exit 1 - sh .ci/check_python_dists.sh ./dist || exit 1 + sh .ci/check-python-dists.sh ./dist || exit 1 if [[ $PRODUCES_ARTIFACTS == "true" ]]; then cp dist/lightgbm-$LGB_VER-py3-none-$PLATFORM.whl $BUILD_ARTIFACTSTAGINGDIRECTORY || exit 1 fi @@ -216,7 +216,7 @@ if [[ $TASK == "gpu" ]]; then grep -q 'std::string device_type = "gpu"' ./include/LightGBM/config.h || exit 1 # make sure that changes were really done if [[ $METHOD == "pip" ]]; then sh ./build-python.sh sdist || exit 1 - sh .ci/check_python_dists.sh ./dist || exit 1 + sh .ci/check-python-dists.sh ./dist || exit 1 pip install \ -v \ --config-settings=cmake.define.USE_GPU=ON \ @@ -226,7 +226,7 @@ if [[ $TASK == "gpu" ]]; then exit 0 elif [[ $METHOD == "wheel" ]]; then sh ./build-python.sh bdist_wheel --gpu || exit 1 - sh ./.ci/check_python_dists.sh ./dist || exit 1 + sh ./.ci/check-python-dists.sh ./dist || exit 1 pip install ./dist/lightgbm-$LGB_VER*.whl -v || exit 1 pytest ./tests || exit 1 exit 0 @@ -241,7 +241,7 @@ elif [[ $TASK == "cuda" ]]; then grep -q 'gpu_use_dp = true' ./include/LightGBM/config.h || exit 1 # make sure that changes were really done if [[ $METHOD == "pip" ]]; then sh ./build-python.sh sdist || exit 1 - sh ./.ci/check_python_dists.sh ./dist || exit 1 + sh ./.ci/check-python-dists.sh ./dist || exit 1 pip install \ -v \ --config-settings=cmake.define.USE_CUDA=ON \ @@ -251,7 +251,7 @@ elif [[ $TASK == "cuda" ]]; then exit 0 elif [[ $METHOD == "wheel" ]]; then sh ./build-python.sh bdist_wheel --cuda || exit 1 - sh ./.ci/check_python_dists.sh ./dist || exit 1 + sh ./.ci/check-python-dists.sh ./dist || exit 1 pip install ./dist/lightgbm-$LGB_VER*.whl -v || exit 1 pytest ./tests || exit 1 exit 0 @@ -261,7 +261,7 @@ elif [[ $TASK == "cuda" ]]; then elif [[ $TASK == "mpi" ]]; then if [[ $METHOD == "pip" ]]; then sh ./build-python.sh sdist || exit 1 - sh ./.ci/check_python_dists.sh ./dist || exit 1 + sh ./.ci/check-python-dists.sh ./dist || exit 1 pip install \ -v \ --config-settings=cmake.define.USE_MPI=ON \ @@ -271,7 +271,7 @@ elif [[ $TASK == "mpi" ]]; then exit 0 elif [[ $METHOD == "wheel" ]]; then sh ./build-python.sh bdist_wheel --mpi || exit 1 - sh ./.ci/check_python_dists.sh ./dist || exit 1 + sh ./.ci/check-python-dists.sh ./dist || exit 1 pip install ./dist/lightgbm-$LGB_VER*.whl -v || exit 1 pytest ./tests || exit 1 exit 0 @@ -294,7 +294,7 @@ if [[ $TASK == "regular" ]]; then else if [[ $COMPILER == "gcc" ]]; then objdump -T ./lib_lightgbm.so > ./objdump.log || exit 1 - python ./helpers/check_dynamic_dependencies.py ./objdump.log || exit 1 + python ./.ci/check-dynamic-dependencies.py ./objdump.log || exit 1 fi cp ./lib_lightgbm.so $BUILD_ARTIFACTSTAGINGDIRECTORY/lib_lightgbm.so fi diff --git a/.ci/trigger_dispatch_run.sh b/.ci/trigger-dispatch-run.sh similarity index 95% rename from .ci/trigger_dispatch_run.sh rename to .ci/trigger-dispatch-run.sh index 731450664..7d7bfcad3 100755 --- a/.ci/trigger_dispatch_run.sh +++ b/.ci/trigger-dispatch-run.sh @@ -4,7 +4,7 @@ # Trigger manual workflow run by a dispatch event. # # [usage] -# trigger_dispatch_run.sh +# trigger-dispatch-run.sh # # PR_URL: URL of pull request from which dispatch is triggering. # diff --git a/.github/workflows/optional_checks.yml b/.github/workflows/optional_checks.yml index fe20fb1f5..f794c38e7 100644 --- a/.github/workflows/optional_checks.yml +++ b/.github/workflows/optional_checks.yml @@ -23,7 +23,7 @@ jobs: for i in "${workflows[@]}"; do workflow_name=${i%;*} trigger_phrase=${i#*;} - python "$GITHUB_WORKSPACE/.ci/get_workflow_status.py" "$trigger_phrase" \ + python "$GITHUB_WORKSPACE/.ci/get-workflow-status.py" "$trigger_phrase" \ || { echo "The last reported status from workflow \"$workflow_name\" is failure. Commit fixes and rerun the workflow."; \ exit 1; } done diff --git a/.github/workflows/r_package.yml b/.github/workflows/r_package.yml index fd4567767..0dcf30a27 100644 --- a/.github/workflows/r_package.yml +++ b/.github/workflows/r_package.yml @@ -226,7 +226,7 @@ jobs: $env:R_BUILD_TYPE = "${{ matrix.build_type }}" $env:COMPILER = "${{ matrix.compiler }}" $env:TASK = "${{ matrix.task }}" - & "$env:GITHUB_WORKSPACE/.ci/test_windows.ps1" + & "$env:GITHUB_WORKSPACE/.ci/test-windows.ps1" test-r-sanitizers: name: r-sanitizers (ubuntu-latest, R-devel, ${{ matrix.compiler }} ASAN/UBSAN) timeout-minutes: 60 diff --git a/.github/workflows/r_valgrind.yml b/.github/workflows/r_valgrind.yml index b7008a07f..8593831ee 100644 --- a/.github/workflows/r_valgrind.yml +++ b/.github/workflows/r_valgrind.yml @@ -33,24 +33,24 @@ jobs: - name: Send init status if: ${{ always() }} run: | - $GITHUB_WORKSPACE/.ci/set_commit_status.sh "${{ github.workflow }}" "pending" "${{ github.event.client_payload.pr_sha }}" - $GITHUB_WORKSPACE/.ci/append_comment.sh \ + $GITHUB_WORKSPACE/.ci/set-commit-status.sh "${{ github.workflow }}" "pending" "${{ github.event.client_payload.pr_sha }}" + $GITHUB_WORKSPACE/.ci/append-comment.sh \ "${{ github.event.client_payload.comment_number }}" \ "Workflow **${{ github.workflow }}** has been triggered! 🚀\r\n${GITHUB_SERVER_URL}/microsoft/LightGBM/actions/runs/${GITHUB_RUN_ID}" - name: Run tests with valgrind shell: bash - run: ./.ci/test_r_package_valgrind.sh + run: ./.ci/test-r-package-valgrind.sh - name: Send final status if: ${{ always() }} run: | - $GITHUB_WORKSPACE/.ci/set_commit_status.sh "${{ github.workflow }}" "${{ job.status }}" "${{ github.event.client_payload.pr_sha }}" - $GITHUB_WORKSPACE/.ci/append_comment.sh \ + $GITHUB_WORKSPACE/.ci/set-commit-status.sh "${{ github.workflow }}" "${{ job.status }}" "${{ github.event.client_payload.pr_sha }}" + $GITHUB_WORKSPACE/.ci/append-comment.sh \ "${{ github.event.client_payload.comment_number }}" \ "Status: ${{ job.status }}." - name: Rerun workflow-indicator if: ${{ always() }} run: | - bash $GITHUB_WORKSPACE/.ci/rerun_workflow.sh \ + bash $GITHUB_WORKSPACE/.ci/rerun-workflow.sh \ "optional_checks.yml" \ "${{ github.event.client_payload.pr_number }}" \ "${{ github.event.client_payload.pr_branch }}" \ diff --git a/.github/workflows/triggering_comments.yml b/.github/workflows/triggering_comments.yml index 220a02877..be33a0e81 100644 --- a/.github/workflows/triggering_comments.yml +++ b/.github/workflows/triggering_comments.yml @@ -20,7 +20,7 @@ jobs: - name: Trigger R valgrind tests if: github.event.comment.body == '/gha run r-valgrind' run: | - $GITHUB_WORKSPACE/.ci/trigger_dispatch_run.sh \ + $GITHUB_WORKSPACE/.ci/trigger-dispatch-run.sh \ "${{ github.event.issue.pull_request.url }}" \ "${{ github.event.comment.id }}" \ "gha_run_r_valgrind" @@ -28,7 +28,7 @@ jobs: - name: Trigger update R configure if: github.event.comment.body == '/gha run r-configure' run: | - $GITHUB_WORKSPACE/.ci/trigger_dispatch_run.sh \ + $GITHUB_WORKSPACE/.ci/trigger-dispatch-run.sh \ "${{ github.event.issue.pull_request.url }}" \ "${{ github.event.comment.id }}" \ "gha_run_r_configure" diff --git a/.vsts-ci.yml b/.vsts-ci.yml index f0cae1956..7b7a25d3c 100644 --- a/.vsts-ci.yml +++ b/.vsts-ci.yml @@ -328,7 +328,7 @@ jobs: git clean -d -f -x displayName: 'Clean source directory' - script: | - cmd /c "powershell -ExecutionPolicy Bypass -File %BUILD_SOURCESDIRECTORY%/.ci/install_opencl.ps1" + cmd /c "powershell -ExecutionPolicy Bypass -File %BUILD_SOURCESDIRECTORY%/.ci/install-opencl.ps1" condition: eq(variables['TASK'], 'bdist') displayName: 'Install OpenCL' - script: | @@ -337,7 +337,7 @@ jobs: cmd /c "conda config --add channels conda-forge" cmd /c "conda config --set channel_priority strict" cmd /c "conda init powershell" - cmd /c "powershell -ExecutionPolicy Bypass -File %BUILD_SOURCESDIRECTORY%/.ci/test_windows.ps1" + cmd /c "powershell -ExecutionPolicy Bypass -File %BUILD_SOURCESDIRECTORY%/.ci/test-windows.ps1" displayName: Test - task: PublishBuildArtifacts@1 condition: and(succeeded(), in(variables['TASK'], 'regular', 'bdist', 'swig'), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/'))) @@ -419,7 +419,7 @@ jobs: artifactName: R-package downloadPath: $(Build.SourcesDirectory)/R - script: | - python "$(Build.SourcesDirectory)/.nuget/create_nuget.py" "$(Build.SourcesDirectory)/binaries/PackageAssets" + python "$(Build.SourcesDirectory)/.ci/create-nuget.py" "$(Build.SourcesDirectory)/binaries/PackageAssets" displayName: 'Create NuGet configuration files' - task: NuGetCommand@2 inputs: diff --git a/docs/Parameters.rst b/docs/Parameters.rst index de2bc5472..e7b6fb1cd 100644 --- a/docs/Parameters.rst +++ b/docs/Parameters.rst @@ -1,4 +1,4 @@ -.. List of parameters is auto generated by LightGBM\helpers\parameter_generator.py from LightGBM\include\LightGBM\config.h file. +.. List of parameters is auto generated by LightGBM\.ci\parameter-generator.py from LightGBM\include\LightGBM\config.h file. .. role:: raw-html(raw) :format: html diff --git a/docs/README.rst b/docs/README.rst index 5821a8176..baaaac469 100644 --- a/docs/README.rst +++ b/docs/README.rst @@ -6,7 +6,7 @@ and `Breathe `__, which works on top of `Doxyge List of parameters and their descriptions in `Parameters.rst <./Parameters.rst>`__ is generated automatically from comments in `config file `__ -by `this script `__. +by `this script `__. After each commit on ``master``, documentation is updated and published to `Read the Docs `__. diff --git a/src/io/config_auto.cpp b/src/io/config_auto.cpp index ca4fda1c3..5192add28 100644 --- a/src/io/config_auto.cpp +++ b/src/io/config_auto.cpp @@ -3,7 +3,7 @@ * Licensed under the MIT License. See LICENSE file in the project root for license information. * * \note - * This file is auto generated by LightGBM\helpers\parameter_generator.py from LightGBM\include\LightGBM\config.h file. + * This file is auto generated by LightGBM\.ci\parameter-generator.py from LightGBM\include\LightGBM\config.h file. */ #include namespace LightGBM {