Skip to content

Commit d4ec695

Browse files
committed
adding mypy to precommit hook, updating dev requirements
1 parent d7baaaf commit d4ec695

File tree

4 files changed

+30
-0
lines changed

4 files changed

+30
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
venv/
22
__pycache__/
3+
.mypy_cache
34
.cache/
45
.DS_Store
56
*.pyc

hooks/pre-commit.sh

+6
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,9 @@ if [ $? -ne 0 ]; then
88
echo "Tests failed, commit aborted. 🤕"
99
exit 1
1010
fi
11+
12+
./hooks/run-static-check.sh
13+
if [ $? -ne 0 ]; then
14+
echo "Type checker reported errors, commit aborted."
15+
exit 1
16+
fi

hooks/run-static-check.sh

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bash
2+
3+
# exit as soon as any line fails
4+
set -e
5+
6+
# make sure we are always in our project's root dir
7+
cd "${0%/*}/.."
8+
9+
echo "running mypy type checks..."
10+
mypy fmrest --ignore-missing-imports
11+
12+
exit $?
13+

requirements-dev.txt

+10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
appnope==0.1.0
22
certifi==2017.11.5
33
chardet==3.0.4
4+
cycler==0.10.0
45
decorator==4.1.2
56
idna==2.6
67
ipykernel==4.6.1
@@ -9,25 +10,34 @@ ipython-genutils==0.2.0
910
jedi==0.11.0
1011
jupyter-client==5.1.0
1112
jupyter-core==4.4.0
13+
matplotlib==2.1.0
1214
mock==2.0.0
15+
mypy==0.610
1316
numpy==1.13.3
1417
pandas==0.21.0
1518
parso==0.1.0
1619
pbr==3.1.1
1720
pexpect==4.2.1
1821
pickleshare==0.7.4
22+
pkginfo==1.4.2
1923
prompt-toolkit==1.0.15
24+
psutil==5.4.1
2025
ptyprocess==0.5.2
2126
py==1.4.34
2227
Pygments==2.2.0
28+
pyparsing==2.2.0
2329
pytest==3.2.3
2430
python-dateutil==2.6.1
2531
pytz==2017.3
2632
pyzmq==16.0.3
2733
requests==2.18.4
34+
requests-toolbelt==0.8.0
2835
simplegeneric==0.8.1
2936
six==1.11.0
3037
tornado==4.5.2
38+
tqdm==4.23.4
3139
traitlets==4.3.2
40+
twine==1.11.0
41+
typed-ast==1.1.0
3242
urllib3==1.22
3343
wcwidth==0.1.7

0 commit comments

Comments
 (0)