Skip to content

check_yaml hook has YAML file parsing issues #984

@bibermann

Description

@bibermann

The check_yaml hook has parsing issues when parsing a list containing an unquoted string with a colon, e.g.

key: [val:ue]

Can be fixed by configuring ruamel-yaml such that it's using its pure Python implementation instead of libyaml, like explained here: https://stackoverflow.com/a/62160118/704821

Affected code:

yaml = ruamel.yaml.YAML(typ='safe')

Fix:

- yaml = ruamel.yaml.YAML(typ='safe')
+ yaml = ruamel.yaml.YAML(typ='safe', pure=True)

This may lead to slower parsing though.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions