Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/ansiblelint/transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ def run(self) -> None:
continue

if file_is_yaml:
_logger.debug("Dumping %s using YAML (%s)", file, yaml.version)
# noinspection PyUnboundLocalVariable
file.content = yaml.dumps(ruamel_data)

Expand Down
4 changes: 3 additions & 1 deletion src/ansiblelint/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
from pathlib import Path
from typing import Any

import ruamel.yaml.parser
import yaml
from ansible.errors import AnsibleError, AnsibleParserError
from ansible.module_utils.parsing.convert_bool import boolean
Expand Down Expand Up @@ -910,8 +911,9 @@ def construct_mapping(
yaml.parser.ParserError,
yaml.scanner.ScannerError,
yaml.constructor.ConstructorError,
ruamel.yaml.parser.ParserError,
) as exc:
msg = "Failed to load YAML file"
msg = f"Failed to load YAML file: {lintable.path}"
raise RuntimeError(msg) from exc

if len(result) == 0:
Expand Down