mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-09-11 15:13:27 +02:00
lint: better type safety
This commit is contained in:
parent
d0559f864e
commit
80371da133
@ -260,14 +260,14 @@ def main():
|
||||
# Regex checks in all kinds of fields
|
||||
for f in regex_warnings:
|
||||
for m, r in regex_warnings[f]:
|
||||
t = metadata.metafieldtype(f)
|
||||
if t == 'string':
|
||||
if app[f] is None:
|
||||
v = app[f]
|
||||
if type(v) == str:
|
||||
if v is None:
|
||||
continue
|
||||
if m.match(app[f]):
|
||||
if m.match(v):
|
||||
warn("%s '%s': %s" % (f, app[f], r))
|
||||
elif t == 'multiline':
|
||||
for l in app[f]:
|
||||
elif type(v) == list:
|
||||
for l in v:
|
||||
if m.match(l):
|
||||
warn("%s at line '%s': %s" % (f, l, r))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user