From bcd4084685f355ec67e939d371c501809d06e260 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=85ke=20Forslund?= Date: Wed, 15 May 2019 11:46:25 +0200 Subject: [PATCH] Switch pep8 for pycodestyle - Make sure the pycodestyle installed with mycroft-core is used - Ignore binary operator warning --- scripts/pre-commit | 7 +++++-- test-requirements.txt | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/pre-commit b/scripts/pre-commit index d0cf54185e..01affc6d43 100755 --- a/scripts/pre-commit +++ b/scripts/pre-commit @@ -13,7 +13,7 @@ import tempfile # don't fill in both of these select_codes = [] ignore_codes = ["E121", "E122", "E123", "E124", "E125", "E126", "E127", "E128", - "E129", "E501", "E722", "E226"] + "E129", "E501", "E722", "E226", "W504"] # Add things like "--max-line-length=120" below overrides = [] @@ -40,7 +40,10 @@ def main(): with open(filename, 'w') as f: system('git', 'show', ':' + name, stdout=f) - args = ['pep8'] + checker_path = os.path.join(os.path.dirname(__file__), + '..', '..', '.venv', 'bin', 'pycodestyle') + checker_path = os.path.abspath(checker_path) + args = [checker_path] if select_codes and ignore_codes: print(u'Error: select and ignore codes are mutually exclusive') sys.exit(1) diff --git a/test-requirements.txt b/test-requirements.txt index 8ada8157c9..68b6937b91 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,4 +1,4 @@ -pep8==1.7.0 +pycodestyle===2.5.0 coveralls==1.5.0 pytest==3.5.0 pytest-cov==2.5.1