-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy path.pre-commit-config.yaml
68 lines (68 loc) · 2.61 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
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
# See
# https://medium.com/staqu-dev-logs/keeping-python-code-clean-with-pre-commit-hooks-black-flake8-and-isort-cac8b01e0ea1
default_language_version:
python: python3.9
exclude: (?x)(^docs/_build)
repos:
- repo: https://github.com/psf/black
rev: 22.8.0
hooks:
- id: black # Format Python code
additional_dependencies: [--index-url=https://pypi.org/simple/]
- repo: https://github.com/pre-commit/mirrors-autopep8
rev: v1.7.0 # Use the sha / tag you want to point at
hooks:
- id: autopep8
additional_dependencies: [--index-url=https://pypi.org/simple/]
- repo: https://github.com/pycqa/flake8
rev: 5.0.4
hooks:
- id: flake8 # Apply flake 8 python file linter
additional_dependencies:
- --index-url=https://pypi.org/simple/
- flake8-annotations==2.9.1
- flake8-bugbear==22.8.23
- flake8-docstrings==1.6.0
- flake8-walrus==1.2.0
- flake8-typing-imports==1.13.0
- repo: https://github.com/adrienverge/yamllint
rev: v1.27.1
hooks:
- id: yamllint # Check YAML Files
args: [-d, '{extends: relaxed, rules: {line-length: {max: 120 }}}']
additional_dependencies: [--index-url=https://pypi.org/simple/]
- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
rev: 0.2.2
hooks:
- id: yamlfmt
name: yamlfmt
args: [--sequence, '4', --offset, '2', --mapping, '2', --width, '120', --implicit_start]
exclude: ^infrastructure/charts/[^/]+/templates
additional_dependencies: [--index-url=https://pypi.org/simple/]
- repo: https://github.com/PyCQA/doc8
rev: v1.0.0
hooks:
- id: doc8
args: [--max-line-length, '120']
additional_dependencies: [--index-url=https://pypi.org/simple/]
- repo: https://github.com/asottile/pyupgrade
rev: v2.37.3
hooks:
- id: pyupgrade
args: [--py3-plus]
additional_dependencies: [--index-url=https://pypi.org/simple/]
- repo: https://github.com/python-poetry/poetry
rev: 1.3.2
hooks:
- id: poetry-check
additional_dependencies: [--index-url=https://pypi.org/simple/]
- id: poetry-lock
args: [--check]
files: ^pyproject.toml$
additional_dependencies: [--index-url=https://pypi.org/simple/]
- id: poetry-export
args: [-f, requirements.txt, -o, requirements.txt, --with=dev, --with=doc, -Eall]
files: ^(pyproject.toml|poetry.lock)$
additional_dependencies: [--index-url=https://pypi.org/simple/]