mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-05 23:10:29 +03:00
Use counters in lint
This commit is contained in:
parent
905e58f54c
commit
8249324a7b
1 changed files with 7 additions and 7 deletions
|
|
@ -22,6 +22,7 @@ import re
|
|||
import logging
|
||||
import common
|
||||
import metadata
|
||||
from collections import Counter
|
||||
|
||||
config = None
|
||||
options = None
|
||||
|
|
@ -129,20 +130,19 @@ regex_pedantic = {
|
|||
|
||||
def main():
|
||||
|
||||
global config, options, appid, app_count, warn_count
|
||||
global config, options, appid, count
|
||||
appid = None
|
||||
|
||||
app_count = 0
|
||||
warn_count = 0
|
||||
count = Counter()
|
||||
|
||||
def warn(message):
|
||||
global appid, app_count, warn_count
|
||||
global appid, count
|
||||
if appid:
|
||||
print "%s:" % appid
|
||||
appid = None
|
||||
app_count += 1
|
||||
count['app'] += 1
|
||||
print ' %s' % message
|
||||
warn_count += 1
|
||||
count['warn'] += 1
|
||||
|
||||
def pwarn(message):
|
||||
if options.pedantic:
|
||||
|
|
@ -246,7 +246,7 @@ def main():
|
|||
if not appid:
|
||||
print
|
||||
|
||||
logging.info("Found a total of %i warnings in %i apps." % (warn_count, app_count))
|
||||
logging.info("Found a total of %i warnings in %i apps." % (count['warn'], count['app']))
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue