Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 15, 2024
1 parent b4a0a01 commit 0448135
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 5 additions & 1 deletion plugins/sub_plugins/validate/jsonschema.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,11 @@ def _validate_jsonschema(self):

suppress_fields = []
if suppress_output:
suppress_fields = suppress_output if isinstance(suppress_output, list) else ["found", "relative_schema"]
suppress_fields = (
suppress_output
if isinstance(suppress_output, list)
else ["found", "relative_schema"]
)

for validation_error in validation_errors:
if isinstance(validation_error, jsonschema.ValidationError):
Expand Down
4 changes: 3 additions & 1 deletion tests/unit/plugins/action/test_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,8 @@ def test_suppress_output_is_a_list(self):
"suppress_output": ["relative_schema"],
}

result = self._plugin.run(task_vars=dict(ansible_validate_jsonschema_suppress_output=['relative_schema']))
result = self._plugin.run(
task_vars=dict(ansible_validate_jsonschema_suppress_output=["relative_schema"])
)
self.assertIn("found", result)
self.assertNotIn("relative_schema", result)

0 comments on commit 0448135

Please sign in to comment.