Files
lightgbm-org--lightgbm/.pre-commit-config.yaml
T
2026-07-13 13:27:18 +08:00

116 lines
3.1 KiB
YAML

# exclude files which are auto-generated by build tools
exclude: |
(?x)^(
build|
external_libs|
lightgbm-python|
lightgbm_r|
\.pixi|
)$
|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: v6.0.0
hooks:
- id: check-toml
- id: check-xml
- 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.38.0
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
rev: v0.15.20
hooks:
- id: ruff-check
args: ["--config", "python-package/pyproject.toml"]
types_or: [python, jupyter]
- id: ruff-format
args: ["--config", "python-package/pyproject.toml"]
types_or: [python, jupyter]
- repo: https://github.com/biomejs/pre-commit
rev: v2.5.2
hooks:
- id: biome-ci
args:
- --config-path=./biome.json
- --diagnostic-level=info
- --error-on-warnings
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.11.0.1
hooks:
- id: shellcheck
- repo: https://github.com/crate-ci/typos
rev: v1.48.0
hooks:
- id: typos
args: ["--force-exclude"]
exclude: (\.gitignore$)|(^\.editorconfig$)
- repo: https://github.com/henryiii/validate-pyproject-schema-store
rev: 2026.06.30
hooks:
- id: validate-pyproject
files: python-package/pyproject.toml$
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v2.1.0
hooks:
- id: mypy
args: ["--config-file", "python-package/pyproject.toml", "python-package/"]
pass_filenames: false
verbose: true
additional_dependencies:
- matplotlib>=3.9.1
- narwhals>=1.15
- pandas>=2.0
- scikit-learn>=1.5.2
- repo: https://github.com/zizmorcore/zizmor-pre-commit
rev: v1.26.1
hooks:
- id: zizmor