mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-05 15:00:30 +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)
|
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():
|
def main():
|
||||||
|
|
||||||
global config, options
|
global config, options
|
||||||
|
|
||||||
anywarns = False
|
|
||||||
|
|
||||||
# Parse command line...
|
# Parse command line...
|
||||||
parser = ArgumentParser(usage="%(prog)s [options] [APPID [APPID ...]]")
|
parser = ArgumentParser(usage="%(prog)s [options] [APPID [APPID ...]]")
|
||||||
common.setup_global_opts(parser)
|
common.setup_global_opts(parser)
|
||||||
|
|
@ -354,13 +357,13 @@ def main():
|
||||||
allapps = metadata.read_metadata(xref=True)
|
allapps = metadata.read_metadata(xref=True)
|
||||||
apps = common.read_app_args(options.appid, allapps, False)
|
apps = common.read_app_args(options.appid, allapps, False)
|
||||||
|
|
||||||
|
anywarns = False
|
||||||
|
|
||||||
for appid, app in apps.items():
|
for appid, app in apps.items():
|
||||||
if app.Disabled:
|
if app.Disabled:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
warns = []
|
app_check_funcs = [
|
||||||
|
|
||||||
for check_func in [
|
|
||||||
check_regexes,
|
check_regexes,
|
||||||
check_ucm_tags,
|
check_ucm_tags,
|
||||||
check_char_limits,
|
check_char_limits,
|
||||||
|
|
@ -374,16 +377,12 @@ def main():
|
||||||
check_bulleted_lists,
|
check_bulleted_lists,
|
||||||
check_builds,
|
check_builds,
|
||||||
check_files_dir,
|
check_files_dir,
|
||||||
]:
|
check_format,
|
||||||
warns += check_func(app)
|
]
|
||||||
|
|
||||||
if options.format:
|
for check_func in app_check_funcs:
|
||||||
if not rewritemeta.proper_format(app):
|
for warn in check_func(app):
|
||||||
warns.append("Run rewritemeta to fix formatting")
|
|
||||||
|
|
||||||
if warns:
|
|
||||||
anywarns = True
|
anywarns = True
|
||||||
for warn in warns:
|
|
||||||
print("%s: %s" % (appid, warn))
|
print("%s: %s" % (appid, warn))
|
||||||
|
|
||||||
if anywarns:
|
if anywarns:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue