diff --git a/platformio/commands/check/command.py b/platformio/commands/check/command.py index d1f01f5c..3d430b02 100644 --- a/platformio/commands/check/command.py +++ b/platformio/commands/check/command.py @@ -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) diff --git a/tests/commands/test_check.py b/tests/commands/test_check.py index 028798ef..b079aaad 100644 --- a/tests/commands/test_check.py +++ b/tests/commands/test_check.py @@ -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