Skip to content
Merged
Show file tree
Hide file tree
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
File renamed without changes.
13 changes: 1 addition & 12 deletions .ci/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ if [[ $TASK == "lint" ]]; then
# shellcheck disable=SC1091
source activate "${CONDA_ENV}"
echo "Linting Python and bash code"
bash ./.ci/lint-python-bash.sh || exit 1
bash ./.ci/run-pre-commit-mypy.sh || exit 1
echo "Linting R code"
Rscript ./.ci/lint-r-code.R "${BUILD_DIRECTORY}" || exit 1
echo "Linting C++ code"
Expand All @@ -129,19 +129,8 @@ if [[ $TASK == "check-docs" ]] || [[ $TASK == "check-links" ]]; then
conda env create \
-n "${CONDA_ENV}" \
--file ./docs/env.yml || exit 1
conda install \
-q \
-y \
-n "${CONDA_ENV}" \
'doxygen>=1.10.0' \
'rstcheck>=6.2.4' || exit 1
# shellcheck disable=SC1091
source activate "${CONDA_ENV}"
# check reStructuredText formatting
find "${BUILD_DIRECTORY}/python-package" -type f -name "*.rst" \
-exec rstcheck --report-level warning {} \+ || exit 1
find "${BUILD_DIRECTORY}/docs" -type f -name "*.rst" \
-exec rstcheck --report-level warning --ignore-directives=autoclass,autofunction,autosummary,doxygenfile {} \+ || exit 1
# build docs
make -C docs html || exit 1
if [[ $TASK == "check-links" ]]; then
Expand Down
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ repos:
hooks:
- id: yamllint
args: ["--strict"]
- repo: https://github.com/rstcheck/rstcheck
rev: v6.2.5
hooks:
- id: rstcheck
args: ["--config", "./python-package/pyproject.toml"]
additional_dependencies:
- breathe>=4.36.0
- sphinx>=8.1.3
- sphinx_rtd_theme>=3.0.1
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.12.5
Expand Down
3 changes: 2 additions & 1 deletion docs/env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ channels:
- nodefaults
- conda-forge
dependencies:
- breathe>=4.35
- breathe>=4.36
- doxygen>=1.13.2
- python=3.12
- r-base>=4.3.3
- r-data.table=1.16.4
Expand Down
2 changes: 1 addition & 1 deletion python-package/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ To check that a contribution to the package matches its style expectations, run

.. code:: sh

bash .ci/lint-python-bash.sh
bash .ci/run-pre-commit-mypy.sh

To run the tests locally and compute test coverage, install the Python package using one of the options mentioned above.
Then run the following from the root of the repo.
Expand Down
9 changes: 9 additions & 0 deletions python-package/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,15 @@ disallow_untyped_defs = true
exclude = 'build/*|compile/*|docs/*|examples/*|external_libs/*|lightgbm-python/*|tests/*'
ignore_missing_imports = true

[tool.rstcheck]
report_level = "WARNING"
ignore_directives = [
"autoclass",
"autofunction",
"autosummary",
"doxygenfile"
]

[tool.ruff]
exclude = [
"build",
Expand Down
Loading