mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-06 07:20:29 +03:00
Count warnings and apps in lint
This commit is contained in:
parent
6d8dd4bed2
commit
2f3a92cd29
1 changed files with 9 additions and 6 deletions
|
|
@ -111,24 +111,27 @@ regex_pedantic = {
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
appid = None
|
|
||||||
|
|
||||||
def main():
|
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):
|
def warn(message):
|
||||||
global appid
|
global appid, app_count, warn_count
|
||||||
if appid:
|
if appid:
|
||||||
print "%s:" % appid
|
print "%s:" % appid
|
||||||
appid = None
|
appid = None
|
||||||
|
app_count += 1
|
||||||
print ' %s' % message
|
print ' %s' % message
|
||||||
|
warn_count += 1
|
||||||
|
|
||||||
def pwarn(message):
|
def pwarn(message):
|
||||||
if options.pedantic:
|
if options.pedantic:
|
||||||
warn(message)
|
warn(message)
|
||||||
|
|
||||||
|
|
||||||
# Parse command line...
|
# Parse command line...
|
||||||
parser = OptionParser(usage="Usage: %prog [options] [APPID [APPID ...]]")
|
parser = OptionParser(usage="Usage: %prog [options] [APPID [APPID ...]]")
|
||||||
parser.add_option("-p", "--pedantic", action="store_true", default=False,
|
parser.add_option("-p", "--pedantic", action="store_true", default=False,
|
||||||
|
|
@ -224,7 +227,7 @@ def main():
|
||||||
if not appid:
|
if not appid:
|
||||||
print
|
print
|
||||||
|
|
||||||
logging.info("Finished.")
|
logging.info("Found a total of %i warnings in %i apps." % (warn_count, app_count))
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue