Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable the "Yaml::PARSE_CUSTOM_TAGS" flag #166

Open
benjy8001 opened this issue Nov 22, 2024 · 3 comments
Open

Enable the "Yaml::PARSE_CUSTOM_TAGS" flag #166

benjy8001 opened this issue Nov 22, 2024 · 3 comments
Assignees

Comments

@benjy8001
Copy link

Hi,

I recently ugrade a CI config, and get this message :
Tags support is not enabled. Enable the "Yaml::PARSE_CUSTOM_TAGS" flag to use "!reference" at line 306 (near "!reference [.deploy_template, script] # Ceci inclut le script du template").

I try with --parse-tags option, but this option doesn't seems to exists :
yaml-lint 1.1.6, symfony/yaml v7.0.3: File --parse-tags does not exist

How can i enable the tag support ?

Thanks !

@j13k
Copy link
Owner

j13k commented Nov 24, 2024

Hi @benjy8001,

There is no --parse-tags parameter in this tool.

This tool is simply a wrapper for calling the Yaml::parse() function of the symfony/yaml component, and the error message you've quoted actually comes from the upstream component.

In order to keep things simple, this tool invokes the parse function with some sensible defaults:

Yaml::parse($content, Yaml::PARSE_EXCEPTION_ON_INVALID_TYPE);

The flag you've mentioned isn't currently included, but I'll look into enabling this shortly if it doesn't result in too many side effects.

@j13k
Copy link
Owner

j13k commented Nov 24, 2024

P.S. If you need a quick solution for this, you may want to investigate/switch to the official Symfony Console implementation of the YAML 'Lint' command, as this already provides an option for enabling 'parse tags':

https://symfony.com/doc/current/components/yaml.html#syntax-validation

@j13k j13k self-assigned this Nov 24, 2024
@j13k j13k moved this from Triage to Todo in j13k/yaml-lint Nov 24, 2024
@benjy8001
Copy link
Author

Thanks, but actually i use the docker phpqa jackzal image for my ci 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

2 participants