from argparse import ArgumentParser
import re
-import common
-import metadata
import sys
from sets import Set
+import common
+import metadata
+import rewritemeta
+
config = None
options = None
"Flattr donation methods belong in the FlattrID flag"),
],
'Changelog': http_checks,
+ 'Author Name': [
+ (re.compile(r'^\s'),
+ "Unnecessary leading space"),
+ (re.compile(r'.*\s$'),
+ "Unnecessary trailing space"),
+ ],
'License': [
(re.compile(r'^(|None|Unknown)$'),
"No license specified"),
"No need to specify that the app is for Android"),
(re.compile(r'.*[a-z0-9][.!?]( |$)'),
"Punctuation should be avoided"),
+ (re.compile(r'^\s'),
+ "Unnecessary leading space"),
+ (re.compile(r'.*\s$'),
+ "Unnecessary trailing space"),
],
'Description': [
(re.compile(r'^No description available$'),
# Parse command line...
parser = ArgumentParser(usage="%(prog)s [options] [APPID [APPID ...]]")
common.setup_global_opts(parser)
+ parser.add_argument("-f", "--format", action="store_true", default=False,
+ help="Also warn about formatting issues, like rewritemeta -l")
parser.add_argument("appid", nargs='*', help="app-id in the form APPID")
options = parser.parse_args()
]:
warns += check_func(app)
+ if options.format:
+ if not rewritemeta.proper_format(app):
+ warns.append("Run rewritemeta to fix formatting")
+
if warns:
anywarns = True
for warn in warns:
- print "%s: %s" % (appid, warn)
+ print("%s: %s" % (appid, warn))
if anywarns:
sys.exit(1)