.pre-commit-config.yaml 1.56 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
  - repo: https://github.com/astral-sh/ruff-pre-commit
    # Ruff version.
32
    rev: v0.12.5
33
34
35
36
    hooks:
      # Run the linter.
      - id: ruff
        args: ["--config", "python-package/pyproject.toml"]
37
        types_or: [python, jupyter]
38
39
40
      # Run the formatter.
      - id: ruff-format
        args: ["--config", "python-package/pyproject.toml"]
41
        types_or: [python, jupyter]
42
43
44
  - repo: https://github.com/shellcheck-py/shellcheck-py
    rev: v0.10.0.1
    hooks:
45
46
      - id: shellcheck
  - repo: https://github.com/crate-ci/typos
47
    rev: v1.34.0
48
49
50
51
    hooks:
      - id: typos
        args: ["--force-exclude"]
        exclude: (\.gitignore$)|(^\.editorconfig$)
52
  - repo: https://github.com/henryiii/validate-pyproject-schema-store
53
    rev: 2025.07.14
54
55
56
    hooks:
      - id: validate-pyproject
        files: python-package/pyproject.toml$