generated from ansible-collections/collection_template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
101 lines (91 loc) · 3.1 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
---
repos:
- repo: https://github.com/ansible-network/collection_prep
rev: 1.1.1
hooks:
- id: update-docs
# - id: autoversion
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-merge-conflict
- id: check-symlinks
- id: debug-statements
- id: end-of-file-fixer
- id: no-commit-to-branch
args: [--branch, main]
- id: trailing-whitespace
- repo: https://github.com/asottile/add-trailing-comma.git
rev: v2.4.0
hooks:
- id: add-trailing-comma
args:
- --py36-plus
- repo: https://github.com/Lucas-C/pre-commit-hooks.git
rev: v1.5.1
hooks:
- id: remove-tabs
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.0.0-alpha.9-for-vscode"
hooks:
- id: prettier
# Original hook implementation is flaky due to *several* bugs described
# in https://github.com/prettier/prettier/issues/12364
# a) CI=1 needed to avoid incomplete output
# b) two executions are needed because --list-different works correctly
# only when run with --check as with --write the output will also
# include other entries and logging level cannot be used to keep only
# modified files listed (any file is listed using the log level, regardless if
# is modified or not).
# c) We avoid letting pre-commit pass each filename in order to avoid
# running multiple instances in parallel. This also ensures that running
# prettier from the command line behaves identically with the pre-commit
# one. No real performance downsides.
# d) exit with the return code from list-different (0=none, 1=some)
# rather than the write (0=successfully rewrote files). pre-commit.ci
entry: env CI=1 bash -c "prettier --list-different . || ec=$? && prettier --loglevel=error --write . && exit $ec"
pass_filenames: false
args: []
additional_dependencies:
- prettier
- prettier-plugin-toml
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.0.263"
hooks:
- id: ruff
args:
- "--exit-non-zero-on-fix"
# - repo: https://github.com/streetsidesoftware/cspell-cli
# rev: v6.31.0
# hooks:
# - id: cspell
# name: Spell check with cspell
- repo: https://github.com/terrencepreilly/darglint.git
rev: v1.8.1
hooks:
- id: darglint
- repo: https://github.com/pycqa/pylint.git
rev: v3.0.0a6
hooks:
- id: pylint
args:
- --output-format=colorized
additional_dependencies:
- ansible-core
- pytest
- tox
- git+https://github.com/ansible-network/pytest-ansible-network-integration.git
- repo: https://github.com/pre-commit/mirrors-mypy.git
rev: v1.2.0
hooks:
- id: mypy
additional_dependencies:
- jinja2
- pytest
args:
- --python-version=3.10
pass_filenames: false