mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-05 06:50: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 logging
|
||||||
import common
|
import common
|
||||||
import metadata
|
import metadata
|
||||||
|
from collections import Counter
|
||||||
|
|
||||||
config = None
|
config = None
|
||||||
options = None
|
options = None
|
||||||
|
|
@ -129,20 +130,19 @@ regex_pedantic = {
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
||||||
global config, options, appid, app_count, warn_count
|
global config, options, appid, count
|
||||||
appid = None
|
appid = None
|
||||||
|
|
||||||
app_count = 0
|
count = Counter()
|
||||||
warn_count = 0
|
|
||||||
|
|
||||||
def warn(message):
|
def warn(message):
|
||||||
global appid, app_count, warn_count
|
global appid, count
|
||||||
if appid:
|
if appid:
|
||||||
print "%s:" % appid
|
print "%s:" % appid
|
||||||
appid = None
|
appid = None
|
||||||
app_count += 1
|
count['app'] += 1
|
||||||
print ' %s' % message
|
print ' %s' % message
|
||||||
warn_count += 1
|
count['warn'] += 1
|
||||||
|
|
||||||
def pwarn(message):
|
def pwarn(message):
|
||||||
if options.pedantic:
|
if options.pedantic:
|
||||||
|
|
@ -246,7 +246,7 @@ def main():
|
||||||
if not appid:
|
if not appid:
|
||||||
print
|
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__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue