From df563d339acc2c35b896823625f96fd867494326 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Thu, 14 May 2020 11:54:32 +0200 Subject: [PATCH] fix pep8 E741 ambiguous variable name 'l' --- fdroidserver/install.py | 4 ++-- fdroidserver/lint.py | 22 +++++++++++----------- fdroidserver/scanner.py | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/fdroidserver/install.py b/fdroidserver/install.py index 968bb28f..c526f1ec 100644 --- a/fdroidserver/install.py +++ b/fdroidserver/install.py @@ -36,11 +36,11 @@ def devices(): p = SdkToolsPopen(['adb', "devices"]) if p.returncode != 0: raise FDroidException("An error occured when finding devices: %s" % p.output) - lines = [l for l in p.output.splitlines() if not l.startswith('* ')] + lines = [line for line in p.output.splitlines() if not line.startswith('* ')] if len(lines) < 3: return [] lines = lines[1:-1] - return [l.split()[0] for l in lines] + return [line.split()[0] for line in lines] def main(): diff --git a/fdroidserver/lint.py b/fdroidserver/lint.py index 276bf555..ab7d422c 100644 --- a/fdroidserver/lint.py +++ b/fdroidserver/lint.py @@ -189,9 +189,9 @@ def check_regexes(app): v = app.get(f) t = metadata.fieldtype(f) if t == metadata.TYPE_MULTILINE: - for l in v.splitlines(): - if m.match(l): - yield "%s at line '%s': %s" % (f, l, r) + for line in v.splitlines(): + if m.match(line): + yield "%s at line '%s': %s" % (f, line, r) else: if v is None: continue @@ -345,12 +345,12 @@ def check_duplicates(app): yield _("Description '%s' is just the app's summary") % app.Summary seenlines = set() - for l in app.Description.splitlines(): - if len(l) < 1: + for line in app.Description.splitlines(): + if len(line) < 1: continue - if l in seenlines: + if line in seenlines: yield _("Description has a duplicate line") - seenlines.add(l) + seenlines.add(line) desc_url = re.compile(r'(^|[^[])\[([^ ]+)( |\]|$)') @@ -369,18 +369,18 @@ def check_bulleted_lists(app): validchars = ['*', '#'] lchar = '' lcount = 0 - for l in app.Description.splitlines(): - if len(l) < 1: + for line in app.Description.splitlines(): + if len(line) < 1: lcount = 0 continue - if l[0] == lchar and l[1] == ' ': + if line[0] == lchar and line[1] == ' ': lcount += 1 if lcount > 2 and lchar not in validchars: yield _("Description has a list (%s) but it isn't bulleted (*) nor numbered (#)") % lchar break else: - lchar = l[0] + lchar = line[0] lcount = 1 diff --git a/fdroidserver/scanner.py b/fdroidserver/scanner.py index db990f97..3d5b700f 100644 --- a/fdroidserver/scanner.py +++ b/fdroidserver/scanner.py @@ -250,7 +250,7 @@ def scan_source(build_dir, build=metadata.Build()): if is_used_by_gradle(line): for name in suspects_found(line): count += handleproblem('usual suspect \'%s\' at line %d' % (name, i + 1), path_in_build_dir, filepath) - noncomment_lines = [l for l in lines if not common.gradle_comment.match(l)] + noncomment_lines = [line for line in lines if not common.gradle_comment.match(line)] joined = re.sub(r'[\n\r\s]+', ' ', ' '.join(noncomment_lines)) for m in gradle_mavenrepo.finditer(joined): url = m.group(2)