summaryrefslogtreecommitdiffstats
path: root/.pre-commit-config.yaml
blob: 57d12648ffb8b0d4550f3555795067786c503326 (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
repos:

  - repo: local
    hooks:
      - id: shfmt
        name: shfmt
        language: golang
        additional_dependencies: [mvdan.cc/sh/v3/cmd/shfmt@v3.1.2]
        entry: shfmt
        args: [-w, -s]
        types: [text]
        files: ^(bash_completion|completions/.+|test/(config/bashrc|update-test-cmd-list)|.+\.sh(\.in)?)$
        exclude: ^completions/(\.gitignore|Makefile.*)$

  - repo: https://github.com/shellcheck-py/shellcheck-py
    rev: v0.7.1.1
    hooks:
      - id: shellcheck
        args: [-f, gcc]
        types: [text]
        files: ^(bash_completion|completions/.+|test/(config/bashrc|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

  - repo: https://github.com/psf/black
    rev: 19.10b0
    hooks:
      - id: black
        types: [text]
        files: ^(helpers/python|.+\.py)$
        exclude: ^completions/

  - repo: https://gitlab.com/pycqa/flake8
    rev: 3.8.3
    hooks:
      - id: flake8
        args: [--config=test/setup.cfg]
        additional_dependencies: [flake8-bugbear==20.1.4]
        types: [text]
        files: ^(helpers/python|.+\.py)$
        exclude: ^completions/

  - repo: https://github.com/timothycrosley/isort
    rev: 5.1.4
    hooks:
      - id: isort
        args: [--settings-path=test/setup.cfg]
        types: [text]
        files: ^(helpers/python|.+\.py)$
        exclude: ^completions/

  - repo: https://github.com/pre-commit/mirrors-mypy
    rev: v0.782
    hooks:
      - id: mypy
        args: [--config-file=test/setup.cfg]
        # Intentionally not run on helpers/python (support very old versions)
        exclude: ^completions/|^test/fixtures/pytest/

  - repo: https://github.com/asottile/pyupgrade
    rev: v2.7.2
    hooks:
      - id: pyupgrade
        args: [--py3-plus, --keep-percent-format]
        exclude: ^completions/

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

  - repo: local
    hooks:
      - id: perlcritic
        name: perlcritic
        language: perl
        additional_dependencies: [PETDANCE/Perl-Critic-1.138.tar.gz]
        entry: perlcritic
        args: [--quiet, --verbose, "5"]
        types: [text]
        files: ^(helpers/perl|.+\.p[ml])$

  - repo: https://github.com/igorshubovych/markdownlint-cli
    rev: v0.23.2
    hooks:
      - id: markdownlint