diff --git a/src/bitwarden_workflow_linter/rules/run_actionlint.py b/src/bitwarden_workflow_linter/rules/run_actionlint.py index c754e5b..f34aeb5 100644 --- a/src/bitwarden_workflow_linter/rules/run_actionlint.py +++ b/src/bitwarden_workflow_linter/rules/run_actionlint.py @@ -72,14 +72,15 @@ def __init__(self, settings: Optional[Settings] = None) -> None: def fn(self, obj: Workflow) -> Tuple[bool, str]: if not obj.filename: - raise NotImplementedError("Running actionlint without a filename is not currently supported") + raise NotImplementedError( + "Running actionlint without a filename is not currently supported" + ) installed, install_error = check_actionlint() if installed: result = subprocess.run( ["actionlint", obj.filename], capture_output=True, text=True, - check=False, ) if result.returncode == 1: print(result.stdout) diff --git a/tests/rules/test_run_actionlint.py b/tests/rules/test_run_actionlint.py index 7d00de6..dad0615 100644 --- a/tests/rules/test_run_actionlint.py +++ b/tests/rules/test_run_actionlint.py @@ -9,17 +9,21 @@ yaml = YAML() + @pytest.fixture(name="rule") def fixture_rule(): return RunActionlint() + def test_rule_on_correct_workflow(rule): - correct_workflow = WorkflowBuilder.build("tests/fixtures/test_workflow.yaml") + correct_workflow = WorkflowBuilder.build("tests/fixtures/test_workflow.yaml") result, _ = rule.fn(correct_workflow) assert result is True def test_rule_on_incorrect_workflow(rule): - incorrect_workflow = WorkflowBuilder.build("tests/fixtures/test_workflow_incorrect.yaml") + incorrect_workflow = WorkflowBuilder.build( + "tests/fixtures/test_workflow_incorrect.yaml" + ) result, _ = rule.fn(incorrect_workflow) assert result is False