# exclude files which are auto-generated by build tools exclude: | (?x)^( build| external_libs| lightgbm-python| lightgbm_r| )$ |R-package/configure$ |R-package/inst/Makevars$ |R-package/inst/Makevars.win$ |R-package/man/.*Rd$ repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v5.0.0 hooks: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/cmake-lint/cmake-lint rev: '1.4.3' hooks: - id: cmakelint args: ["--linelength=120"] - repo: https://github.com/cpplint/cpplint rev: '2.0.2' hooks: - id: cpplint args: - --root=.. # workaround to get correct header guard pattern - --recursive - --filter=-build/include_subdir,-whitespace/line_length - repo: local hooks: - id: check-omp-pragmas name: check-omp-pragmas entry: sh args: - .ci/check-omp-pragmas.sh language: system pass_filenames: false - repo: https://github.com/adrienverge/yamllint rev: v1.37.1 hooks: - id: yamllint args: ["--strict"] - repo: local hooks: - id: regenerate-parameters name: regenerate-parameters entry: python args: - ./.ci/parameter-generator.py language: python pass_filenames: false - 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.14.0 hooks: # Run the linter. - id: ruff-check args: ["--config", "python-package/pyproject.toml"] types_or: [python, jupyter] # Run the formatter. - id: ruff-format args: ["--config", "python-package/pyproject.toml"] types_or: [python, jupyter] - repo: https://github.com/shellcheck-py/shellcheck-py rev: v0.10.0.1 hooks: - id: shellcheck - repo: https://github.com/crate-ci/typos rev: v1.34.0 hooks: - id: typos args: ["--force-exclude"] exclude: (\.gitignore$)|(^\.editorconfig$) - repo: https://github.com/henryiii/validate-pyproject-schema-store rev: 2025.07.14 hooks: - id: validate-pyproject files: python-package/pyproject.toml$ - repo: https://github.com/pre-commit/mirrors-mypy rev: v1.18.2 hooks: - id: mypy verbose: true entry: bash -c 'mypy --config-file=./python-package/pyproject.toml ./python-package || true' additional_dependencies: - matplotlib>=3.9.1 - pyarrow>=17.0 - scikit-learn>=1.5.2