mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-05 06:50:29 +03:00
lint: make the check for format a regular check
This commit is contained in:
parent
0c6269bb67
commit
0711ddb376
1 changed files with 26 additions and 27 deletions
|
|
@ -334,12 +334,15 @@ def check_files_dir(app):
|
|||
yield "Unused file at %s" % os.path.join(dir_path, name)
|
||||
|
||||
|
||||
def check_format(app):
|
||||
if options.format and not rewritemeta.proper_format(app):
|
||||
yield "Run rewritemeta to fix formatting"
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
global config, options
|
||||
|
||||
anywarns = False
|
||||
|
||||
# Parse command line...
|
||||
parser = ArgumentParser(usage="%(prog)s [options] [APPID [APPID ...]]")
|
||||
common.setup_global_opts(parser)
|
||||
|
|
@ -354,13 +357,13 @@ def main():
|
|||
allapps = metadata.read_metadata(xref=True)
|
||||
apps = common.read_app_args(options.appid, allapps, False)
|
||||
|
||||
anywarns = False
|
||||
|
||||
for appid, app in apps.items():
|
||||
if app.Disabled:
|
||||
continue
|
||||
|
||||
warns = []
|
||||
|
||||
for check_func in [
|
||||
app_check_funcs = [
|
||||
check_regexes,
|
||||
check_ucm_tags,
|
||||
check_char_limits,
|
||||
|
|
@ -374,16 +377,12 @@ def main():
|
|||
check_bulleted_lists,
|
||||
check_builds,
|
||||
check_files_dir,
|
||||
]:
|
||||
warns += check_func(app)
|
||||
check_format,
|
||||
]
|
||||
|
||||
if options.format:
|
||||
if not rewritemeta.proper_format(app):
|
||||
warns.append("Run rewritemeta to fix formatting")
|
||||
|
||||
if warns:
|
||||
for check_func in app_check_funcs:
|
||||
for warn in check_func(app):
|
||||
anywarns = True
|
||||
for warn in warns:
|
||||
print("%s: %s" % (appid, warn))
|
||||
|
||||
if anywarns:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue