mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-05 23:10:29 +03:00
lint: optionally check format
This commit is contained in:
parent
fa0dcf5449
commit
c2304b3315
2 changed files with 27 additions and 16 deletions
|
|
@ -19,11 +19,13 @@
|
|||
|
||||
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
|
||||
|
||||
|
|
@ -306,6 +308,8 @@ def main():
|
|||
# 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()
|
||||
|
||||
|
|
@ -337,6 +341,10 @@ def main():
|
|||
]:
|
||||
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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue