diff --git a/.travis/run.sh b/.travis/run.sh index 00ec5404f..564e70af4 100755 --- a/.travis/run.sh +++ b/.travis/run.sh @@ -10,4 +10,4 @@ if [[ "$(uname -s)" == "Darwin" ]]; then source ~/.venv/bin/activate fi -python -m pytest -n16 tests/ +make lint tests diff --git a/Makefile b/Makefile index fae5f7f6b..894f6c61e 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,9 @@ .PHONY: build run test lint lint-modules clean prune help -MODULES=routersploit +DIRECTORY=. +EXCLUDED=.git,rsf.py RSF_IMAGE=routersploit -FLAKE8_IGNORED_RULES=E501,W503 +FLAKE8_IGNORED_RULES=E501,F405,F403 build: docker build -t $(RSF_IMAGE) . @@ -11,14 +12,10 @@ run: docker run -it --rm $(RSF_IMAGE) lint: - flake8 --exclude=__init__.py --ignore=$(FLAKE8_IGNORED_RULES) $(MODULES) + python3 -m flake8 --exclude=$(EXCLUDED) --ignore=$(FLAKE8_IGNORED_RULES) $(DIRECTORY) tests: clean -ifeq ($(MODULES), routersploit) - python -m unittest discover -else - python -m unittest $(MODULES) -endif + python3 -m pytest -n16 tests clean: find . -name '*.pyc' -exec rm -f {} + @@ -34,8 +31,6 @@ help: @echo " Run Routersploit in docker container" @echo " lint" @echo " Check style with flake8." - @echo " lint-modules" - @echo " Check modules style with flake8." @echo " test" @echo " Run test suite" @echo " clean" diff --git a/requirements-dev.txt b/requirements-dev.txt index b5befd01d..2ba64d402 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,4 +6,5 @@ pycrypto==2.6.1 pytest==3.5.1 pytest-forked==0.2 pytest-xdist==1.22.2 +flake8==3.5.0 git+git://github.com/threat9/threat9-test-bed