Merge pull request #86 from pjz/black

Add black to travis checking
This commit is contained in:
Conor Patrick 2019-02-12 19:37:57 -05:00 committed by GitHub
commit 747d9a194d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 11 deletions

View File

@ -4,10 +4,12 @@ compiler: gcc
addons:
apt:
sources:
- deadsnakes
- ubuntu-toolchain-r-test
packages:
- gcc-7
- cppcheck
- python3.6
script:
- export CC=gcc-7
- make test

View File

@ -69,22 +69,25 @@ uECC.o: ./crypto/micro-ecc/uECC.c
env2:
virtualenv --python=python2.7 env2
env2/bin/pip install --upgrade -r tools/requirements.txt
env3/bin/pip --version
env2/bin/pip install -r tools/requirements.txt
env3:
python3 -m venv env3
env3/bin/pip install --upgrade -r tools/requirements.txt
env3/bin/pip install --upgrade black
# black requires >=py3.6
virtualenv --python=python3.6 env3
env3/bin/pip --version
env3/bin/pip install -r tools/requirements.txt
env3/bin/pip install black
.PHONY: black blackcheck wink2 wink3 fido2-test cppcheck test clean
# selectively reformat our own code
black: env3
env3/bin/black --skip-string-normalization tools/
wink2: env2
env2/bin/python tools/solotool.py solo --wink
blackcheck: export BLACK_CHECK_FLAG := --check
black blackcheck: env3
env3/bin/black --skip-string-normalization $(BLACK_CHECK_FLAG) tools/
wink3: env3
env3/bin/python tools/solotool.py solo --wink
wink2 wink3: wink% : env%
$</bin/python tools/solotool.py solo --wink
fido2-test: env3
env3/bin/python tools/ctap_test.py
@ -97,7 +100,7 @@ cppcheck:
cppcheck $(CPPCHECK_FLAGS) fido2
cppcheck $(CPPCHECK_FLAGS) pc
test: main cppcheck
test: main cppcheck blackcheck
clean:
rm -f *.o main.exe main $(obj)