mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-09-17 10:40:12 +02:00
lint: start warning about invalid categories
This commit is contained in:
parent
6c85f9d2fa
commit
1fa9ec60a1
@ -23,6 +23,7 @@ import logging
|
|||||||
import common
|
import common
|
||||||
import metadata
|
import metadata
|
||||||
from collections import Counter
|
from collections import Counter
|
||||||
|
from sets import Set
|
||||||
|
|
||||||
config = None
|
config = None
|
||||||
options = 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():
|
def main():
|
||||||
|
|
||||||
@ -153,11 +170,12 @@ def main():
|
|||||||
if app['Web Site'].lower() == app['Source Code'].lower():
|
if app['Web Site'].lower() == app['Source Code'].lower():
|
||||||
warn("Website '%s' is just the app's source code link" % app['Web Site'])
|
warn("Website '%s' is just the app's source code link" % app['Web Site'])
|
||||||
|
|
||||||
# "None" still a category
|
# Missing or incorrect categories
|
||||||
if 'None' in app['Categories']:
|
if not app['Categories']:
|
||||||
warn("Category 'None' is is still present")
|
|
||||||
elif not app['Categories']:
|
|
||||||
warn("Categories are not set")
|
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']:
|
if app['Name'] and app['Name'] == app['Auto Name']:
|
||||||
warn("Name '%s' is just the auto name" % app['Name'])
|
warn("Name '%s' is just the auto name" % app['Name'])
|
||||||
|
Loading…
Reference in New Issue
Block a user