".github/workflows/lychee.yml" did not exist on "f7e64a8f5df7769de9a266b2257cea688e3c4925"
.pre-commit-config.yaml 2.8 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
  - repo: https://github.com/cmake-lint/cmake-lint
    rev: '1.4.3'
    hooks:
      - id: cmakelint
24
        args: ["--linelength=120"]
25
26
27
28
29
  - repo: https://github.com/cpplint/cpplint
    rev: '2.0.2'
    hooks:
      - id: cpplint
        args:
30
          - --root=..  # workaround to get correct header guard pattern
31
          - --recursive
32
          - --filter=-build/include_subdir,-whitespace/line_length
33
34
35
36
37
38
39
40
41
  - repo: local
    hooks:
      - id: check-omp-pragmas
        name: check-omp-pragmas
        entry: sh
        args:
          - .ci/check-omp-pragmas.sh
        language: system
        pass_filenames: false
42
  - repo: https://github.com/adrienverge/yamllint
43
    rev: v1.37.1
44
45
46
    hooks:
      - id: yamllint
        args: ["--strict"]
47
48
49
50
51
52
53
54
55
  - repo: local
    hooks:
      - id: regenerate-parameters
        name: regenerate-parameters
        entry: python
        args:
          - ./.ci/parameter-generator.py
        language: python
        pass_filenames: false
56
57
58
59
60
61
62
63
64
  - 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
65
66
  - repo: https://github.com/astral-sh/ruff-pre-commit
    # Ruff version.
67
    rev: v0.14.0
68
69
    hooks:
      # Run the linter.
70
      - id: ruff-check
71
        args: ["--config", "python-package/pyproject.toml"]
72
        types_or: [python, jupyter]
73
74
75
      # Run the formatter.
      - id: ruff-format
        args: ["--config", "python-package/pyproject.toml"]
76
        types_or: [python, jupyter]
77
78
79
  - repo: https://github.com/shellcheck-py/shellcheck-py
    rev: v0.10.0.1
    hooks:
80
81
      - id: shellcheck
  - repo: https://github.com/crate-ci/typos
82
    rev: v1.34.0
83
84
85
86
    hooks:
      - id: typos
        args: ["--force-exclude"]
        exclude: (\.gitignore$)|(^\.editorconfig$)
87
  - repo: https://github.com/henryiii/validate-pyproject-schema-store
88
    rev: 2025.07.14
89
90
91
    hooks:
      - id: validate-pyproject
        files: python-package/pyproject.toml$
92
93
94
95
96
97
98
99
100
101
  - 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