End of line comment two spaces after the value, wherever it is (ruamel otherwise aligns it with a neighbouring comment, or uses one space when there is none).
(out, key, text)
| 261 | |
| 262 | |
| 263 | def _add_eol_comment(out, key, text): |
| 264 | """End of line comment two spaces after the value, wherever it is (ruamel otherwise aligns it |
| 265 | with a neighbouring comment, or uses one space when there is none).""" |
| 266 | try: |
| 267 | from ruamel.yaml.error import CommentMark |
| 268 | from ruamel.yaml.tokens import CommentToken |
| 269 | |
| 270 | out._yaml_add_eol_comment([CommentToken(f" # {text}", CommentMark(0)), None], key=key) |
| 271 | except (ImportError, AttributeError, TypeError): # pragma: no cover (other ruamel versions) |
| 272 | out.yaml_add_eol_comment(text, key) |
| 273 | |
| 274 | |
| 275 | def _set_ruamel_comment(out, key, comment, indent): |
no outgoing calls
no test coverage detected