mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-06 15:30:28 +03:00
lint: better type safety
This commit is contained in:
parent
d0559f864e
commit
80371da133
1 changed files with 6 additions and 6 deletions
|
|
@ -260,14 +260,14 @@ def main():
|
||||||
# Regex checks in all kinds of fields
|
# Regex checks in all kinds of fields
|
||||||
for f in regex_warnings:
|
for f in regex_warnings:
|
||||||
for m, r in regex_warnings[f]:
|
for m, r in regex_warnings[f]:
|
||||||
t = metadata.metafieldtype(f)
|
v = app[f]
|
||||||
if t == 'string':
|
if type(v) == str:
|
||||||
if app[f] is None:
|
if v is None:
|
||||||
continue
|
continue
|
||||||
if m.match(app[f]):
|
if m.match(v):
|
||||||
warn("%s '%s': %s" % (f, app[f], r))
|
warn("%s '%s': %s" % (f, app[f], r))
|
||||||
elif t == 'multiline':
|
elif type(v) == list:
|
||||||
for l in app[f]:
|
for l in v:
|
||||||
if m.match(l):
|
if m.match(l):
|
||||||
warn("%s at line '%s': %s" % (f, l, r))
|
warn("%s at line '%s': %s" % (f, l, r))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue