.pre-commit-config.yaml 1.84 KB
Newer Older
1
# exclude files which are auto-generated by build tools
2
3
4
5
6
7
8
exclude: |
  (?x)^(
      build|
      external_libs|
      lightgbm-python|
      lightgbm_r|
  )$
9
10
11
12
  |R-package/configure$
  |R-package/inst/Makevars$
  |R-package/inst/Makevars.win$
  |R-package/man/.*Rd$
13
14

repos:
15
  - repo: https://github.com/pre-commit/pre-commit-hooks
16
    rev: v5.0.0
17
18
19
    hooks:
      - id: end-of-file-fixer
      - id: trailing-whitespace
20
21
22
23
24
  - repo: https://github.com/cmake-lint/cmake-lint
    rev: '1.4.3'
    hooks:
      - id: cmakelint
        args: ["--linelength=120", "--filter=-convention/filename,-package/stdargs,-readability/wonkycase"]
25
  - repo: https://github.com/adrienverge/yamllint
26
    rev: v1.37.1
27
28
29
    hooks:
      - id: yamllint
        args: ["--strict"]
30
31
32
33
34
35
36
37
38
  - 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
39
40
  - repo: https://github.com/astral-sh/ruff-pre-commit
    # Ruff version.
41
    rev: v0.12.5
42
43
44
45
    hooks:
      # Run the linter.
      - id: ruff
        args: ["--config", "python-package/pyproject.toml"]
46
        types_or: [python, jupyter]
47
48
49
      # Run the formatter.
      - id: ruff-format
        args: ["--config", "python-package/pyproject.toml"]
50
        types_or: [python, jupyter]
51
52
53
  - repo: https://github.com/shellcheck-py/shellcheck-py
    rev: v0.10.0.1
    hooks:
54
55
      - id: shellcheck
  - repo: https://github.com/crate-ci/typos
56
    rev: v1.34.0
57
58
59
60
    hooks:
      - id: typos
        args: ["--force-exclude"]
        exclude: (\.gitignore$)|(^\.editorconfig$)
61
  - repo: https://github.com/henryiii/validate-pyproject-schema-store
62
    rev: 2025.07.14
63
64
65
    hooks:
      - id: validate-pyproject
        files: python-package/pyproject.toml$