Skip to content

Commit d3afa3b

Browse files
committed
Add pre-commit checks and its configuration
1 parent 3c48fd3 commit d3afa3b

File tree

3 files changed

+47
-0
lines changed

3 files changed

+47
-0
lines changed

.flake8

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[flake8]
2+
max-line-length = 88
3+
4+
per-file-ignores =
5+
#Undefined name exception
6+
test.py: F821
7+
8+
#Line too long, unresolved imports, may be undefined
9+
names.py: E501 F401 F403

.pre-commit-config.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
default_languages_version:
2+
python: python3.8
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v4.3.0
6+
hooks:
7+
- id: no-commit-to-branch # Both main and master are protected by default if no branch argument is set.
8+
- id: check-yaml
9+
- id: detect-private-key
10+
- id: debug-statements
11+
- id: fix-encoding-pragma
12+
13+
- repo: https://github.com/asottile/reorder_python_imports
14+
rev: v3.8.1
15+
hooks:
16+
- id: reorder-python-imports
17+
18+
- repo: https://github.com/psf/black
19+
rev: 22.6.0
20+
hooks:
21+
- id: black
22+
language_version: python3.8
23+
24+
- repo: https://github.com/pycqa/flake8
25+
rev: 4.0.1
26+
hooks:
27+
- id: flake8
28+
additional_dependencies:
29+
- flake8-bugbear
30+
- flake8-comprehensions
31+
- flake8-simplify
32+
33+
- repo: https://github.com/econchick/interrogate
34+
rev: 1.5.0
35+
hooks:
36+
- id: interrogate
37+
args: [-vv, -i, -r, main, -M]

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pre-commit

0 commit comments

Comments
 (0)