Introduce Black to automate code formatting

This commit is contained in:
Ivan Kravets
2019-09-23 23:13:48 +03:00
parent 5e144a2c98
commit 7c41c7c2f3
90 changed files with 4064 additions and 3367 deletions

View File

@@ -42,20 +42,24 @@ def settings_get(name):
raw_value = app.get_setting(key)
formatted_value = format_value(raw_value)
if raw_value != options['value']:
default_formatted_value = format_value(options['value'])
if raw_value != options["value"]:
default_formatted_value = format_value(options["value"])
formatted_value += "%s" % (
"\n" if len(default_formatted_value) > 10 else " ")
formatted_value += "[%s]" % click.style(default_formatted_value,
fg="yellow")
"\n" if len(default_formatted_value) > 10 else " "
)
formatted_value += "[%s]" % click.style(
default_formatted_value, fg="yellow"
)
tabular_data.append(
(click.style(key,
fg="cyan"), formatted_value, options['description']))
(click.style(key, fg="cyan"), formatted_value, options["description"])
)
click.echo(
tabulate(tabular_data,
headers=["Name", "Current value [Default]", "Description"]))
tabulate(
tabular_data, headers=["Name", "Current value [Default]", "Description"]
)
)
@cli.command("set", short_help="Set new value for the setting")