Re: [PATCH 7/7] selftest/bpf: fix E501 line too long
From: Daniel Borkmann <daniel@iogearbox.net>
Date: 2018-12-12 10:24:08
Also in:
lkml
[ +Jakub ] On 12/11/2018 12:56 PM, Alice Ferrazzi wrote:
quoted hunk ↗ jump to hunk
fix PEP8 style issues Signed-off-by: Alice Ferrazzi <redacted> --- tools/testing/selftests/bpf/test_offload.py | 35 +++++++++++++-------- 1 file changed, 22 insertions(+), 13 deletions(-)diff --git a/tools/testing/selftests/bpf/test_offload.py b/tools/testing/selftests/bpf/test_offload.py index b06cc0eea0eb..3f78da0f87d5 100755 --- a/tools/testing/selftests/bpf/test_offload.py +++ b/tools/testing/selftests/bpf/test_offload.py@@ -208,7 +208,8 @@ def bpftool_prog_list_wait(expected=0, n_retry=20): if nprogs == expected: return time.sleep(0.05) - raise Exception("Time out waiting for program counts to stabilize want %d, have %d" % (expected, nprogs)) + raise Exception("Time out waiting for program counts \ +to stabilize want %d, have %d" % (expected, nprogs)) def bpftool_map_list_wait(expected=0, n_retry=20):@@ -217,7 +218,8 @@ def bpftool_map_list_wait(expected=0, n_retry=20): if nmaps == expected: return time.sleep(0.05) - raise Exception("Time out waiting for map counts to stabilize want %d, have %d" % (expected, nmaps)) + raise Exception("Time out waiting for map counts to \ +stabilize want %d, have %d" % (expected, nmaps)) def bpftool_prog_load(sample, file_name, maps=[], prog_type="xdp", dev=None,@@ -413,7 +415,8 @@ class NetdevSim: if nbound == bound and nprogs == total: return time.sleep(0.05) - raise Exception("Time out waiting for program counts to stabilize want %d/%d, have %d bound, %d loaded" % ( + raise Exception("Time out waiting for program counts to \ +stabilize want %d/%d, have %d bound, %d loaded" % ( bound, total, nbound, nprogs))
I'll leave the test_offload.py ones up to Jakub, but to me it seems this particular change here would actually make the code look worse and harder to grep for error messages, so my preference would be to at least leave the error messages as-is. Also seems it's not a 'must' in pep8 [0]. [0] https://www.python.org/dev/peps/pep-0008/#maximum-line-length Thanks, Daniel