.pre-commit-config.yaml 2.06 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: local
    hooks:
      - id: regenerate-parameters
        name: regenerate-parameters
        entry: python
        args:
          - ./.ci/parameter-generator.py
        language: python
        pass_filenames: false
39
40
41
42
43
44
45
46
47
  - 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
48
49
  - repo: https://github.com/astral-sh/ruff-pre-commit
    # Ruff version.
50
    rev: v0.12.5
51
52
53
54
    hooks:
      # Run the linter.
      - id: ruff
        args: ["--config", "python-package/pyproject.toml"]
55
        types_or: [python, jupyter]
56
57
58
      # Run the formatter.
      - id: ruff-format
        args: ["--config", "python-package/pyproject.toml"]
59
        types_or: [python, jupyter]
60
61
62
  - repo: https://github.com/shellcheck-py/shellcheck-py
    rev: v0.10.0.1
    hooks:
63
64
      - id: shellcheck
  - repo: https://github.com/crate-ci/typos
65
    rev: v1.34.0
66
67
68
69
    hooks:
      - id: typos
        args: ["--force-exclude"]
        exclude: (\.gitignore$)|(^\.editorconfig$)
70
  - repo: https://github.com/henryiii/validate-pyproject-schema-store
71
    rev: 2025.07.14
72
73
74
    hooks:
      - id: validate-pyproject
        files: python-package/pyproject.toml$