From: Daniel Martí Date: Sat, 12 Sep 2015 06:30:59 +0000 (-0700) Subject: lint: catch more duplicate links X-Git-Tag: 0.5.0~102 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=ecad89dc059bcb06a276f786ccb60e327e23f587;p=fdroidserver.git lint: catch more duplicate links --- diff --git a/fdroidserver/lint.py b/fdroidserver/lint.py index ad6f4f5c..ca78ad48 100644 --- a/fdroidserver/lint.py +++ b/fdroidserver/lint.py @@ -227,12 +227,18 @@ def check_categories(app): def check_duplicates(app): - if app['Web Site'] and app['Source Code']: - if app['Web Site'].lower() == app['Source Code'].lower(): - yield "Website '%s' is just the app's source code link" % app['Web Site'] - if app['Name'] and app['Name'] == app['Auto Name']: - yield "Name '%s' is just the auto name" % app['Name'] + yield "Name '%s' is just the auto name - remove it" % app['Name'] + + links_seen = set() + for f in ['Source Code', 'Web Site', 'Issue Tracker', 'Changelog']: + if not app[f]: + continue + v = app[f].lower() + if v in links_seen: + yield "Duplicate link in '%s': %s" % (f, v) + else: + links_seen.add(v) name = app['Name'] or app['Auto Name'] if app['Summary'] and name: