From 2f3a92cd2902f3cd2bdd38d61e09f7c47422d639 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20Mart=C3=AD?= Date: Fri, 18 Apr 2014 21:17:06 +0200 Subject: [PATCH] Count warnings and apps in lint --- fdroidserver/lint.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/fdroidserver/lint.py b/fdroidserver/lint.py index 7d36c612..19d4f93b 100644 --- a/fdroidserver/lint.py +++ b/fdroidserver/lint.py @@ -111,24 +111,27 @@ regex_pedantic = { ], } -appid = None - def main(): - global config, options, appid + global config, options, appid, app_count, warn_count + appid = None + + app_count = 0 + warn_count = 0 def warn(message): - global appid + global appid, app_count, warn_count if appid: print "%s:" % appid appid = None + app_count += 1 print ' %s' % message + warn_count += 1 def pwarn(message): if options.pedantic: warn(message) - # Parse command line... parser = OptionParser(usage="Usage: %prog [options] [APPID [APPID ...]]") parser.add_option("-p", "--pedantic", action="store_true", default=False, @@ -224,7 +227,7 @@ def main(): if not appid: print - logging.info("Finished.") + logging.info("Found a total of %i warnings in %i apps." % (warn_count, app_count)) if __name__ == "__main__": main() -- 2.30.2