From 6c7061f3a855d789a225a78ec0c96882463c8c17 Mon Sep 17 00:00:00 2001 From: Arnout Vandecappelle Date: Sat, 27 Aug 2022 22:58:18 +0200 Subject: [PATCH] support/scripts/pkg-stats: fix flake8 errors Fixes flake8 errors: support/scripts/pkg-stats:1013:133: E501 line too long (164 > 132 characters) support/scripts/pkg-stats:1018:36: F541 f-string is missing placeholders support/scripts/pkg-stats:1110:199: E261 at least two spaces before inline comment For the first and the last one, we chose to split the long lines rather than adding noqa: 501. Indeed, the long lines make it very unreadable, and there are relatively natural places where the line can be broken. Also split a line just below the second one in a similar way. The f-string on 1018 doesn't need to be an f-string. Signed-off-by: Arnout Vandecappelle --- support/scripts/pkg-stats | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/support/scripts/pkg-stats b/support/scripts/pkg-stats index aa3b49c809..3248e3678d 100755 --- a/support/scripts/pkg-stats +++ b/support/scripts/pkg-stats @@ -1010,12 +1010,13 @@ def dump_html_pkg(f, pkg): if pkg.latest_version['version'] is None: latest_version_text = "Found, but no version" else: - latest_version_text = f"""{str(pkg.latest_version['version'])}""" + latest_version_text = f"""""" \ + f"""{str(pkg.latest_version['version'])}""" latest_version_text += "
" if pkg.latest_version['status'] == RM_API_STATUS_FOUND_BY_DISTRO: - latest_version_text += f'found by distro' + latest_version_text += 'found by distro' else: latest_version_text += "found by guess" @@ -1107,9 +1108,11 @@ def dump_html_pkg(f, pkg): if not pkg.is_status_ok("cpe"): if pkg.is_actual_package and pkg.current_version: if pkg.cpeid: - f.write(f"""
{pkg.status['cpe'][1]} (Search)\n""") # noqa: E501 + f.write(f"""
{pkg.status['cpe'][1]} (Search)\n""") else: - f.write(f""" {pkg.status['cpe'][1]} (Search)\n""") # noqa: E501 + f.write(f""" {pkg.status['cpe'][1]} (Search)\n""") else: f.write(" %s\n" % pkg.status['cpe'][1])