Skip to content

Commit dd1cc89

Browse files
committed
Add pre-commit config and pyproject.toml
1 parent b4c1624 commit dd1cc89

File tree

3 files changed

+74
-0
lines changed

3 files changed

+74
-0
lines changed

.pre-commit-config.yaml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: 38b88246ccc552bffaaf54259d064beeee434539 # v4.0.1
6+
hooks:
7+
- id: trailing-whitespace
8+
args: [--markdown-linebreak-ext=md]
9+
- id: end-of-file-fixer
10+
- id: check-added-large-files
11+
- id: check-case-conflict
12+
- id: check-executables-have-shebangs
13+
- id: check-ast
14+
- id: check-json
15+
- id: check-yaml
16+
- id: check-toml
17+
- id: check-xml
18+
- id: check-symlinks
19+
- id: destroyed-symlinks
20+
- id: detect-private-key
21+
- id: fix-byte-order-marker
22+
- id: mixed-line-ending
23+
name: "Normalize line endings"
24+
args : [--fix=lf]
25+
26+
- repo: https://github.com/ambv/black
27+
rev: 2f52e4b4929370ec503ee272bcc10d3176db8e89 # 21.5b1
28+
hooks:
29+
- id: black
30+
31+
- repo: https://gitlab.com/pycqa/flake8
32+
rev: c6e0d27593a45342ffa96a18bba708a5aab32fdf # 3.9.2
33+
hooks:
34+
- id: flake8
35+
additional_dependencies: [flake8-bugbear]
36+
37+
- repo: https://github.com/timothycrosley/isort
38+
rev: a6222a8a125ec719724e628a5d3d0d5c60923281 # 5.8.0
39+
hooks:
40+
- id: isort
41+
42+
- repo: https://github.com/pre-commit/mirrors-mypy
43+
rev: b84ce099a2fd3c5216b6ccf3fd176c3828b075fb # v0.812
44+
hooks:
45+
- id: mypy
46+
47+
- repo: https://github.com/jumanjihouse/pre-commit-hooks
48+
rev: 7cc5848088fd8412905ab79feea6c8edc3ac76c6 # 2.1.5
49+
hooks:
50+
- id: forbid-binary
51+
- id: git-dirty
52+
- id: markdownlint
53+
- id: protect-first-parent
54+
- id: shellcheck
55+

pyproject.toml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[tool.black]
2+
py36 = true
3+
include = '\.pyi?$'
4+
exclude = '''
5+
/(
6+
\.git
7+
| \.mypy_cache
8+
| \.tox
9+
| \.venv
10+
| _build
11+
| buck-out
12+
| build
13+
| dist
14+
# The following are specific to Black, you probably don't want those.
15+
| blib2to3
16+
| tests/data
17+
)/
18+
'''

tools/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ requests
33
pyserial
44
cryptography
55
black
6+
pre-commit

0 commit comments

Comments
 (0)