Add tools for checking PEP8 compliance. Fixes #3063

This commit is contained in:
Murtuza Zabuawala 2018-01-29 12:45:32 +00:00 committed by Dave Page
parent 393ce53d2d
commit 489349b4e9
4 changed files with 25 additions and 2 deletions

View File

@ -37,6 +37,9 @@ linter:
check: install-node bundle linter check: install-node bundle linter
cd web && yarn run karma start --single-run && python regression/runtests.py cd web && yarn run karma start --single-run && python regression/runtests.py
check-pep8:
cd web && pycodestyle --config=.pycodestyle .
check-python: check-python:
cd web && python regression/runtests.py --exclude feature_tests cd web && python regression/runtests.py --exclude feature_tests

9
web/.pycodestyle Normal file
View File

@ -0,0 +1,9 @@
[pycodestyle]
ignore = E402
max-line-length = 79
statistics = True
show-source = False
show-pep8 = False
count = True
format = pylint
exclude = migrations,node_modules

View File

@ -95,6 +95,7 @@
"test:karma-once": "yarn run linter && yarn run karma start --single-run", "test:karma-once": "yarn run linter && yarn run karma start --single-run",
"test:karma": "yarn run linter && yarn run karma start", "test:karma": "yarn run linter && yarn run karma start",
"test:feature": "yarn run bundle && python regression/runtests.py --pkg feature_tests", "test:feature": "yarn run bundle && python regression/runtests.py --pkg feature_tests",
"test": "yarn run test:karma-once && yarn run bundle && python regression/runtests.py" "test": "yarn run test:karma-once && yarn run bundle && python regression/runtests.py",
"pep8": "pycodestyle --config=.pycodestyle ."
} }
} }

View File

@ -1,3 +1,12 @@
#####################################
# Include all the common dependencies
#####################################
-r ../../requirements.txt
###########################################
# Add all the development dependencies here
###########################################
pycodestyle==2.3.1
pyperclip~=1.5.27 pyperclip~=1.5.27
selenium==3.3.3; python_version < '2.7' selenium==3.3.3; python_version < '2.7'
selenium==3.7.0; python_version >= '2.7' selenium==3.7.0; python_version >= '2.7'
@ -7,5 +16,6 @@ traceback2==1.4.0
unittest2==1.1.0 unittest2==1.1.0
mock===2.0.0; python_version < '3.3' mock===2.0.0; python_version < '3.3'
# Leave this at the end because there is a bug where the '--install-option' is applied to all subsequent requirements # Leave this at the end because there is a bug where the '--install-option'
# is applied to all subsequent requirements
chromedriver_installer==0.0.6 --install-option='--chromedriver-version=2.33' chromedriver_installer==0.0.6 --install-option='--chromedriver-version=2.33'