Refactor PyLint "inconsistent-return-statements"

This commit is contained in:
Ivan Kravets
2017-12-15 22:16:37 +02:00
parent bff590e207
commit 42fb589369
14 changed files with 48 additions and 24 deletions

View File

@@ -143,6 +143,8 @@ def lib_update(lm, libraries, only_check, json_output):
for library in libraries:
lm.update(library, only_check=only_check)
return True
def print_lib_item(item):
click.secho(item['name'], fg="cyan")
@@ -265,11 +267,13 @@ def lib_list(lm, json_output):
return click.echo(json.dumps(items))
if not items:
return
return None
for item in sorted(items, key=lambda i: i['name']):
print_lib_item(item)
return True
@util.memoized
def get_builtin_libs(storage_names=None):
@@ -308,6 +312,8 @@ def lib_builtin(storage, json_output):
for item in sorted(storage_['items'], key=lambda i: i['name']):
print_lib_item(item)
return True
@cli.command("show", short_help="Show detailed info about a library")
@click.argument("library", metavar="[LIBRARY]")
@@ -381,6 +387,8 @@ def lib_show(library, json_output):
for row in rows:
click.echo(row)
return True
@cli.command("register", short_help="Register a new library")
@click.argument("config_url")
@@ -468,3 +476,5 @@ def lib_stats(json_output):
for item in result.get(key, []):
_print_lib_item(item)
click.echo()
return True