-
Notifications
You must be signed in to change notification settings - Fork 58
/
Copy path.pre-commit-config.yaml
112 lines (103 loc) · 3.69 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
102
103
104
105
106
107
108
109
110
111
112
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: check-merge-conflict # Check for files that contain merge conflict strings.
- id: trailing-whitespace # Trims trailing whitespace.
args: [--markdown-linebreak-ext=md]
- id: mixed-line-ending # Replaces or checks mixed line ending.
args: [--fix=lf]
- id: end-of-file-fixer # Makes sure files end in a newline and only a newline.
- id: check-merge-conflict # Check for files that contain merge conflict strings.
- id: detect-aws-credentials # Detect AWS Credentials
args: [--allow-missing-credentials]
- id: check-json
- id: pretty-format-json
args:
- --autofix
- --indent=2
- --no-sort-keys
- repo: local
hooks:
- id: check-aws-credentials
name: Detect Populated AWS Secrets
entry: .pre-commit-hooks/check-aws-credentials.py
language: script
files: '\.json$'
types: [file]
- id: format-packer-files
name: Format packer files
entry: .pre-commit-hooks/format-packer-files.py
language: script
files: '\.hcl$'
types: [file]
# - id: lint-github-workflows
# name: Lint GitHub Workflows
# entry: -v $(pwd):/repo --workdir /repo rhysd/actionlint:latest -color
# language: docker_image
# files: '.github/workflows/.*\.yml$'
# types: [file]
# ----- Formatting ---------------------------------------------------------------------------->
# - repo: https://github.com/asottile/reorder_python_imports
# rev: v3.13.0
# hooks:
# - id: reorder-python-imports
# args:
# - --py310-plus
# - --add-import=from __future__ import annotations
- repo: https://github.com/asottile/pyupgrade
rev: v3.17.0
hooks:
- id: pyupgrade
name: Rewrite Code to be Py3.10+
args: [
--py310-plus
]
- repo: https://github.com/psf/black
rev: 24.8.0
hooks:
- id: black
args: [-l 100]
- repo: https://github.com/asottile/blacken-docs
rev: 1.18.0
hooks:
- id: blacken-docs
args: [--skip-errors]
files: ^(docs/.*\.rst|src/hbneat/.*\.py)$
additional_dependencies:
- black==24.8.0
# <---- Formatting -----------------------------------------------------------------------------
# ----- Code Analysis ------------------------------------------------------------------------->
- repo: https://github.com/pycqa/flake8
rev: '5.0.4'
hooks:
- id: flake8
exclude: ^(demo/.*|src/hbneat/version\.py|\.pre-commit-hooks/.*\.py)$
additional_dependencies:
- flake8-mypy-fork
- flake8-docstrings
- flake8-typing-imports
- repo: https://github.com/hollow/pre-commit-actionlint
rev: "v1.6.22"
hooks:
- id: actionlint
files: '.github/workflows/.*\.yml$'
# <---- Code Analysis --------------------------------------------------------------------------
# ----- Requirements -------------------------------------------------------------------------->
- repo: https://github.com/jazzband/pip-tools
rev: "6.13.0"
hooks:
- id: pip-compile
alias: pip-compile-tools
name: Compile requirements/tools.in
files: ^requirements/tools\.(in|txt)$
args:
- -v
- --build-isolation
- --resolver=backtracking
- --output-file=requirements/tools.txt
- requirements/tools.in
additional_dependencies:
- pip==23.1.2
# <---- Requirements ---------------------------------------------------------------------------