From c1e5c4f3795fa870cc64fdac0d5dde859db87986 Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Thu, 17 May 2018 12:44:11 +0200 Subject: [PATCH] build: Fix all style reports by pycodestyle v2.4.0 pycodestyle v2.4.0 checks for W606 (async deprecated), but we can't disable it on source code level with '# noqa'. Let's disable the check globaly. We will still catch it with pylint. By disabling the W606 we need also to list the W503 which was previously active. While at it fix following things: ./docs/conf.py:252:6: E121 continuation line under-indented for hanging indent ./docs/conf.py:257:6: E126 continuation line over-indented for hanging indent ./kas/build.py:123:17: W504 line break after binary operator ./kas/configschema.py:48:25: E123 closing bracket does not match indentation of opening bracket's line ./kas/configschema.py:49:21: E123 closing bracket does not match indentation of opening bracket's line ./tests/test_includehandler.py:82:13: E123 closing bracket does not match indentation of opening bracket's line ./tests/test_includehandler.py:121:13: E123 closing bracket does not match indentation of opening bracket's line Signed-off-by: Daniel Wagner --- docs/conf.py | 26 +++++++++++++------------- kas/build.py | 4 ++-- kas/configschema.py | 4 ++-- scripts/checkcode.sh | 2 +- tests/test_includehandler.py | 4 ++-- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 4690447..e801795 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -249,27 +249,27 @@ htmlhelp_basename = 'kasdoc' html_context = { 'extra_css_files': [ '_static/theme_overrides.css', # override wide tables in RTD theme - ], + ], } # -- Options for LaTeX output --------------------------------------------- latex_elements = { - # The paper size ('letterpaper' or 'a4paper'). - # - # 'papersize': 'letterpaper', + # The paper size ('letterpaper' or 'a4paper'). + # + # 'papersize': 'letterpaper', - # The font size ('10pt', '11pt' or '12pt'). - # - # 'pointsize': '10pt', + # The font size ('10pt', '11pt' or '12pt'). + # + # 'pointsize': '10pt', - # Additional stuff for the LaTeX preamble. - # - # 'preamble': '', + # Additional stuff for the LaTeX preamble. + # + # 'preamble': '', - # Latex figure (float) alignment - # - # 'figure_align': 'htbp', + # Latex figure (float) alignment + # + # 'figure_align': 'htbp', } # Grouping the document tree into LaTeX files. List of tuples diff --git a/kas/build.py b/kas/build.py index 316d486..f886ab5 100644 --- a/kas/build.py +++ b/kas/build.py @@ -120,6 +120,6 @@ class BuildCommand(Command): """ # Start bitbake build of image bitbake = find_program(config.environ['PATH'], 'bitbake') - run_cmd([bitbake, '-k', '-c', config.get_bitbake_task()] + - config.get_bitbake_targets(), + run_cmd(([bitbake, '-k', '-c', config.get_bitbake_task()] + + config.get_bitbake_targets()), env=config.environ, cwd=config.build_dir) diff --git a/kas/configschema.py b/kas/configschema.py index b760965..69e7e81 100644 --- a/kas/configschema.py +++ b/kas/configschema.py @@ -45,8 +45,8 @@ CONFIGSCHEMA = { { 'type': 'integer', }, - ], - }, + ], + }, 'includes': { 'type': 'array', 'items': { diff --git a/scripts/checkcode.sh b/scripts/checkcode.sh index 80f0a0a..0c4dee5 100755 --- a/scripts/checkcode.sh +++ b/scripts/checkcode.sh @@ -3,7 +3,7 @@ ERROR=0 echo "Checking with pycodestyle" -pycodestyle $1/*.py $1/*/*.py || ERROR=$(expr $ERROR + 1) +pycodestyle --ignore=W503,W606 $1/*.py $1/*/*.py || ERROR=$(expr $ERROR + 1) echo "Checking with pylint" pylint $1/*.py $1/*/*.py || ERROR=$(expr $ERROR + 2) diff --git a/tests/test_includehandler.py b/tests/test_includehandler.py index cfa4633..5046e8d 100644 --- a/tests/test_includehandler.py +++ b/tests/test_includehandler.py @@ -79,7 +79,7 @@ class TestLoadConfig(object): ('a', exception), ('1', exception), ('a:', exception) - ] + ] self.util_exception_content(testvector) @@ -118,7 +118,7 @@ class TestLoadConfig(object): testvector = [ 'header: {version: 4}', 'header: {version: 5}', - ] + ] for string in testvector: with patch_open(includehandler, string=string): includehandler.load_config('x.yml')