.pre-commit-config.yaml 1.19 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/adrienverge/yamllint
    rev: v1.35.1
    hooks:
      - id: yamllint
        args: ["--strict"]
25
26
  - repo: https://github.com/astral-sh/ruff-pre-commit
    # Ruff version.
27
    rev: v0.8.3
28
29
30
31
    hooks:
      # Run the linter.
      - id: ruff
        args: ["--config", "python-package/pyproject.toml"]
32
        types_or: [python, jupyter]
33
34
35
      # Run the formatter.
      - id: ruff-format
        args: ["--config", "python-package/pyproject.toml"]
36
        types_or: [python, jupyter]
37
38
39
  - repo: https://github.com/shellcheck-py/shellcheck-py
    rev: v0.10.0.1
    hooks:
40
41
      - id: shellcheck
  - repo: https://github.com/crate-ci/typos
42
    rev: v1.28.3
43
44
45
46
    hooks:
      - id: typos
        args: ["--force-exclude"]
        exclude: (\.gitignore$)|(^\.editorconfig$)