Setup pre-commit hooks for Python code
[releng/builder.git] / .pre-commit-config.yaml
1 ---
2 repos:
3   - repo: https://github.com/pre-commit/pre-commit-hooks
4     rev: v2.5.0
5     hooks:
6       - id: check-json
7       - id: trailing-whitespace
8
9   - repo: https://github.com/jorisroovers/gitlint
10     rev: v0.13.1
11     hooks:
12       - id: gitlint
13
14   - repo: https://github.com/jumanjihouse/pre-commit-hooks
15     sha: 2.0.2
16     hooks:
17       - id: shellcheck
18         exclude: >
19             (?x)^(
20                 jjb/global-jjb/.*|
21                 jenkins-config/.*
22             )$
23
24   - repo: https://github.com/ambv/black
25     rev: stable
26     hooks:
27       - id: black
28
29   - repo: https://gitlab.com/pycqa/flake8
30     rev: 3.8.3
31     hooks:
32       - id: flake8
33         args: ["--max-line-length=88"]
34
35   - repo: https://github.com/pycqa/bandit
36     rev: 1.6.2
37     hooks:
38       - id: bandit
39         # Bandit does not need to run on test code
40         exclude: tests/*
41
42   - repo: https://github.com/pycqa/pydocstyle
43     rev: 5.0.2
44     hooks:
45       - id: pydocstyle
46
47   - repo: https://github.com/adrienverge/yamllint
48     rev: v1.23.0
49     hooks:
50       - id: yamllint
51
52   - repo: local
53     hooks:
54       # TODO: Switch to upstream hook when https://github.com/btford/write-good/pull/119 is merged.
55       - id: write-good
56         name: write-good
57         description: Check docs for English prose with write-good
58         entry: write-good
59         language: node
60         files: "\\.(rst|md|markdown|mdown|mkdn)$"
61         additional_dependencies: ["write-good"]
62         exclude: docs/jenkins.rst