From 1fa9ec60a19894be9d0317b5d4b3867703569c0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Wed, 17 Jun 2015 19:55:30 +0200 Subject: [PATCH] lint: start warning about invalid categories --- fdroidserver/lint.py | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/fdroidserver/lint.py b/fdroidserver/lint.py index f8d7d1a0..421b2b88 100644 --- a/fdroidserver/lint.py +++ b/fdroidserver/lint.py @@ -23,6 +23,7 @@ import logging import common import metadata from collections import Counter +from sets import Set config = None options = None @@ -89,6 +90,22 @@ regex_warnings = { ], } +categories = Set([ + "Children", + "Development", + "Games", + "Internet", + "Multimedia", + "Navigation", + "Office", + "Phone & SMS", + "Reading", + "Science & Education", + "Security", + "System", + "Wallpaper", +]) + def main(): @@ -153,11 +170,12 @@ def main(): if app['Web Site'].lower() == app['Source Code'].lower(): warn("Website '%s' is just the app's source code link" % app['Web Site']) - # "None" still a category - if 'None' in app['Categories']: - warn("Category 'None' is is still present") - elif not app['Categories']: + # Missing or incorrect categories + if not app['Categories']: warn("Categories are not set") + for categ in app['Categories']: + if categ not in categories: + warn("Category '%s' is not valid" % categ) if app['Name'] and app['Name'] == app['Auto Name']: warn("Name '%s' is just the auto name" % app['Name'])