From 489349b4e9aacc59132cc32ed6f39530b1f1ef28 Mon Sep 17 00:00:00 2001 From: Murtuza Zabuawala Date: Mon, 29 Jan 2018 12:45:32 +0000 Subject: [PATCH] Add tools for checking PEP8 compliance. Fixes #3063 --- Makefile | 3 +++ web/.pycodestyle | 9 +++++++++ web/package.json | 3 ++- web/regression/requirements.txt | 12 +++++++++++- 4 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 web/.pycodestyle diff --git a/Makefile b/Makefile index 6136162af..4c0f70f5b 100644 --- a/Makefile +++ b/Makefile @@ -37,6 +37,9 @@ linter: check: install-node bundle linter cd web && yarn run karma start --single-run && python regression/runtests.py +check-pep8: + cd web && pycodestyle --config=.pycodestyle . + check-python: cd web && python regression/runtests.py --exclude feature_tests diff --git a/web/.pycodestyle b/web/.pycodestyle new file mode 100644 index 000000000..ec01c1ad5 --- /dev/null +++ b/web/.pycodestyle @@ -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 diff --git a/web/package.json b/web/package.json index 43f96ca95..85427972e 100644 --- a/web/package.json +++ b/web/package.json @@ -95,6 +95,7 @@ "test:karma-once": "yarn run linter && yarn run karma start --single-run", "test:karma": "yarn run linter && yarn run karma start", "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 ." } } diff --git a/web/regression/requirements.txt b/web/regression/requirements.txt index 69f4a2797..cb9335306 100644 --- a/web/regression/requirements.txt +++ b/web/regression/requirements.txt @@ -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 selenium==3.3.3; python_version < '2.7' selenium==3.7.0; python_version >= '2.7' @@ -7,5 +16,6 @@ traceback2==1.4.0 unittest2==1.1.0 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'