summaryrefslogtreecommitdiffstats
path: root/.pre-commit-config.yaml
blob: 6ba238229387ccc870a796f7c1b63d4f42c94606 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
default_stages: [commit]
minimum_pre_commit_version: 2.4.0

repos:

  - repo: https://github.com/jorisroovers/gitlint
    rev: v0.19.1
    hooks:
      - id: gitlint

  - repo: https://github.com/scop/pre-commit-shfmt
    rev: v3.8.0-1
    hooks:
      - id: shfmt
        types: [text]
        files: ^(bash_completion(\.d/[^/]+\.bash)?|completions/.+|test/(config/bashrc|fallback/update-fallback-links|runLint|update-test-cmd-list)|.+\.sh(\.in)?)$
        exclude: ^completions/(\.gitignore|Makefile.*)$

  - repo: https://github.com/shellcheck-py/shellcheck-py
    rev: v0.9.0.6
    hooks:
      - id: shellcheck
        args: [-f, gcc]
        types: [text]
        files: ^(bash_completion(\.d/[^/]+\.bash)?|completions/.+|test/(config/bashrc|fallback/update-fallback-links|runLint|update-test-cmd-list)|.+\.sh(\.in)?)$
        exclude: ^completions/(\.gitignore|Makefile.*)$
        require_serial: false  # We disable SC1090 anyway, so parallel is ok

  - repo: local
    hooks:
      - id: update-test-cmd-list
        name: update-test-cmd-list
        language: script
        entry: test/update-test-cmd-list
        files: ^test/t/.+\.py$
        pass_filenames: false

      - id: update-test-fallback-links
        name: update-test-fallback-links
        language: script
        entry: test/fallback/update-fallback-links
        files: ^completions/_
        pass_filenames: false

  - repo: https://github.com/astral-sh/ruff-pre-commit
    rev: v0.2.2
    hooks:
      - id: ruff
        types: [text]
        files: ^(helpers/python|.+\.py)$
        exclude: ^completions/
      - id: ruff-format
        types: [text]
        files: ^(helpers/python|.+\.py)$
        exclude: ^completions/

  - repo: local
    hooks:
      - id: mypy
        name: mypy
        language: python
        additional_dependencies:
          - venv-run==0.2.0
        entry: venv-run mypy
        args: [--config-file=test/setup.cfg]
        types: [python]
        # Intentionally not run on helpers/python (we support very old versions)
        exclude: ^completions/|^test/fixtures/pytest/

  - repo: https://github.com/perltidy/perltidy
    rev: "20240202"
    hooks:
      - id: perltidy
        types: [text]
        files: ^(helpers/perl|.+\.p[ml])$

  - repo: https://github.com/scop/pre-commit-perlcritic
    rev: v1.144-1
    hooks:
      - id: perlcritic
        args: [--quiet, --verbose, "5"]
        types: [text]
        files: ^(helpers/perl|.+\.p[ml])$

  - repo: https://github.com/jackdewinter/pymarkdown
    rev: v0.9.17
    hooks:
      - id: pymarkdown
        entry: pymarkdown
        args:
          - --config=.pymarkdown.json
          - scan
        exclude: ^CHANGELOG\.md$

  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v4.5.0
    hooks:
      - id: check-case-conflict

  - repo: https://github.com/crate-ci/typos
    rev: v1.18.2
    hooks:
      - id: typos
        exclude: ^(CHANGELOG\.md|test/(test-cmd-list\.txt|fixtures/.+))$