1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-09-17 10:40:12 +02:00

Add source and issue tracker link warnings

This commit is contained in:
Daniel Martí 2014-01-16 17:47:55 +01:00
parent 66e540772f
commit f2b25679ff

View File

@ -18,6 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from optparse import OptionParser
import re
import common, metadata
config = None
@ -48,6 +49,25 @@ def main():
allapps = metadata.read_metadata(xref=False)
apps = common.read_app_args(args, allapps, False)
regex_warnings = {
'Source Code': [
(re.compile(r'.*code\.google\.com/p/[^/]+/source/.*'),
"/source is enough on its own"),
(re.compile(r'.*code\.google\.com/p/[^/]+[/]*$'),
"/source is missing")
],
'Issue Tracker': [
(re.compile(r'.*code\.google\.com/p/[^/]+/issues/.*'),
"/issues is enough on its own"),
(re.compile(r'.*code\.google\.com/p/[^/]+[/]*$'),
"/issues is missing"),
(re.compile(r'.*github\.com/[^/]+/[^/]+/issues/.*'),
"/issues is enough on its own"),
(re.compile(r'.*github\.com/[^/]+/[^/]+[/]*$'),
"/issues is missing")
]
}
for app in apps:
appid = app['id']
lastcommit = ''
@ -70,6 +90,13 @@ def main():
if any(lastchar==c for c in ['.', ',', '!', '?']):
warn("Summary should not end with a %s" % lastchar)
for f in ['Source Code', 'Issue Tracker']:
if f not in regex_warnings:
continue
for m, r in regex_warnings[f]:
if m.match(app[f]):
warn("%s url '%s': %s" % (f, app[f], r))
desc_chars = 0
for line in app['Description']:
desc_chars += len(line)