Skip to content

Commit fee72bb

Browse files
Add pre-commit hook with black and flake8(#153)
1 parent 2e4d4e9 commit fee72bb

6 files changed

+54
-18
lines changed

.flake8

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[flake8]
2+
ignore = E501, F403, C901, F601, W503
3+
max-line-length = 79
4+
max-complexity = 18
5+
select = B,C,E,F,W,T4,B9

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,6 @@ env3/
103103

104104
# pytest
105105
.pytest_cache/
106+
107+
# Text Editors
108+
.vscode/

.pre-commit-config.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
repos:
2+
- repo: https://github.com/ambv/black
3+
rev: stable
4+
hooks:
5+
- id: black
6+
language_version: python3.7
7+
- repo: https://github.com/pre-commit/pre-commit-hooks
8+
rev: v1.2.3
9+
hooks:
10+
- id: flake8

pyproject.toml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[tool.black]
2+
line-length = 79
3+
include = '\.pyi?$'
4+
exclude = '''
5+
/(
6+
\.git
7+
| \.hg
8+
| \.mypy_cache
9+
| \.tox
10+
| \.venv
11+
| _build
12+
| buck-out
13+
| build
14+
| dist
15+
)/
16+
'''

requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ coveralls==1.3.0
99
docker==3.6.0
1010
flake8==3.0.4
1111
lxml==4.2.1
12+
pre-commit==1.14.4
1213
pytest==3.5.1
1314
pytest-cov==2.5.1
1415
python-dateutil==2.7.3

setup.py

+19-18
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,25 @@
1111
long_description = f.read()
1212

1313
install_requires = [
14-
'beautifulsoup4==4.7.1',
15-
'beautifultable==0.7.0',
16-
'boto==2.49.0',
17-
'boto3==1.9.88',
18-
'botocore==1.12.116',
19-
'click==6.7',
20-
'coverage==4.5.1',
21-
'coveralls==1.3.0',
22-
'docker==3.6.0',
23-
'flake8==3.0.4',
24-
'lxml==4.2.1',
25-
'pytest==3.5.1',
26-
'pytest-cov==2.5.1',
27-
'python-dateutil==2.7.3',
28-
'requests==2.20.0',
29-
'requests-toolbelt==0.8.0',
30-
'responses==0.9.0',
31-
'validators==0.12.2',
14+
"beautifulsoup4==4.7.1",
15+
"beautifultable==0.7.0",
16+
"boto==2.49.0",
17+
"boto3==1.9.88",
18+
"botocore==1.12.116",
19+
"click==6.7",
20+
"coverage==4.5.1",
21+
"coveralls==1.3.0",
22+
"docker==3.6.0",
23+
"flake8==3.0.4",
24+
"lxml==4.2.1",
25+
"pre-commit==1.14.4",
26+
"pytest==3.5.1",
27+
"pytest-cov==2.5.1",
28+
"python-dateutil==2.7.3",
29+
"requests==2.20.0",
30+
"requests-toolbelt==0.8.0",
31+
"responses==0.9.0",
32+
"validators==0.12.2",
3233
]
3334

3435
setup(

0 commit comments

Comments
 (0)