Fix code formatting

This commit is contained in:
valeros
2019-10-25 17:43:52 +03:00
parent 49acf4bdb9
commit 4e43e7d3c3
2 changed files with 11 additions and 7 deletions

View File

@ -67,7 +67,7 @@ def cli(
silent,
verbose,
json_output,
fail_on_defect
fail_on_defect,
):
app.set_session_var("custom_project_conf", project_conf)
@ -140,7 +140,9 @@ def cli(
result["succeeded"] = rc == 0
if fail_on_defect:
result["succeeded"] = rc == 0 and not any(
d.severity == DefectItem.SEVERITY_HIGH for d in result["defects"])
d.severity == DefectItem.SEVERITY_HIGH
for d in result["defects"]
)
result["stats"] = collect_component_stats(result)
results.append(result)
@ -149,8 +151,10 @@ def cli(
if not json_output and not silent:
if rc != 0:
click.echo("Error: %s failed to perform check! Please "
"examine tool output in verbose mode." % tool)
click.echo(
"Error: %s failed to perform check! Please "
"examine tool output in verbose mode." % tool
)
elif not result["defects"]:
click.echo("No defects found")
print_processing_footer(result)

View File

@ -287,11 +287,11 @@ def test_check_fails_on_defects_only_with_flag(clirunner, tmpdir):
tmpdir.join("platformio.ini").write(config)
tmpdir.mkdir("src").join("main.cpp").write(TEST_CODE)
default_result = clirunner.invoke(
cmd_check, ["--project-dir", str(tmpdir)])
default_result = clirunner.invoke(cmd_check, ["--project-dir", str(tmpdir)])
result_with_flag = clirunner.invoke(
cmd_check, ["--project-dir", str(tmpdir), "--fail-on-defect"])
cmd_check, ["--project-dir", str(tmpdir), "--fail-on-defect"]
)
assert default_result.exit_code == 0
assert result_with_flag.exit_code != 0