forked from pact-foundation/pact-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
81 lines (73 loc) · 2.17 KB
/
.pre-commit-config.yaml
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
default_install_hook_types:
- commit-msg
- pre-commit
- pre-push
repos:
# Generic hooks that apply to a lot of files
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
- id: check-symlinks
- id: destroyed-symlinks
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
# The following only check that the files are parseable and does _not_
# modify the formatting.
- id: check-toml
- id: check-xml
- id: check-yaml
exclude: |
(?x)^(
mkdocs.yml
)$
- repo: https://gitlab.com/bmares/check-json5
rev: v1.0.0
hooks:
# As above, this only checks for valid JSON files. This implementation
# allows for comments within JSON files.
- id: check-json5
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.1.0
hooks:
- id: prettier
stages: [pre-push]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.4
hooks:
- id: ruff
# Exclude python files in pact/** and tests/**, except for the
# files in src/pact/v3/** and tests/v3/**.
exclude: ^(src/pact|tests)/(?!v3/).*\.py$
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
exclude: ^(pact|tests)/(?!v3/).*\.py$
- repo: https://github.com/commitizen-tools/commitizen
rev: v3.28.0
hooks:
- id: commitizen
stages: [commit-msg]
- repo: local
hooks:
# Mypy is difficult to run pre-commit's isolated environment as it needs
# to be able to find dependencies.
- id: mypy
name: mypy
entry: hatch run mypy
language: system
types: [python]
exclude: ^(src/pact|tests)/(?!v3/).*\.py$
stages: [pre-push]
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.41.0
hooks:
- id: markdownlint
exclude: |
(?x)^(
.github/PULL_REQUEST_TEMPLATE\.md
| CHANGELOG.md
)