-
Notifications
You must be signed in to change notification settings - Fork 273
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
Can't ignore spercific line #462
Comments
that's basically the same issue as rhe recent #460 |
Haven't seen the issue. Have I correctly understood - there is no way to skip checks just for 1 line in such case ? |
@Alexhha the problem is that the file isn't valid YAML, and thus yamllint can't parse it. You can't ignore parser errors. You wouldn't want yamllint to ignore parser errors, because it might incorrectly parse what comes next in the file leading to false positives or negatives. A good workaround is to put the non-yaml content in comments, like this logging:
# %{ if cloudwatch_enabled == "true" ~}
driver: awslogs
options:
awslogs-region: us-east-1
awslogs-group: group
awslogs-stream: ${node_id}
# %{ else ~}
driver: json-file
options:
max-size: "50m"
max-file: "10"
# %{ endif ~} |
Lots of user confusion expecting `disable-line` to work around parser errors caused by templating syntax. Relates to adrienverge#61, adrienverge#65, adrienverge#128, adrienverge#311, adrienverge#460, adrienverge#462
Lots of user confusion expecting `disable-line` to work around parser errors caused by templating syntax. Relates to adrienverge#61, adrienverge#65, adrienverge#128, adrienverge#311, adrienverge#460, adrienverge#462
Lots of user confusion expecting `disable-line` to work around parser errors caused by templating syntax. Relates to adrienverge#61, adrienverge#65, adrienverge#128, adrienverge#311, adrienverge#460, adrienverge#462
Lots of user confusion expecting `disable-line` to work around parser errors caused by templating syntax. Relates to adrienverge#61, adrienverge#65, adrienverge#128, adrienverge#311, adrienverge#460, adrienverge#462
Lots of user confusion expecting `disable-line` to work around parser errors caused by templating syntax. Relates to adrienverge#61, adrienverge#65, adrienverge#128, adrienverge#311, adrienverge#460, adrienverge#462
Unfortunately it doesn't work in such way. Got the following result
|
Lots of user confusion expecting `disable-line` to work around parser errors caused by templating syntax. Relates to adrienverge#61, adrienverge#65, adrienverge#128, adrienverge#311, adrienverge#460, adrienverge#462
Lots of user confusion expecting `disable-line` to work around parser errors caused by templating syntax. Relates to adrienverge#61, adrienverge#65, adrienverge#128, adrienverge#311, adrienverge#460, adrienverge#462
Lots of user confusion expecting `disable-line` to work around parser errors caused by templating syntax. Relates to adrienverge#61, adrienverge#65, adrienverge#128, adrienverge#311, adrienverge#460, adrienverge#462
Lots of user confusion expecting `disable-line` to work around parser errors caused by templating syntax. Relates to adrienverge#61, adrienverge#65, adrienverge#128, adrienverge#311, adrienverge#460, adrienverge#462
Lots of user confusion expecting `disable-line` to work around parser errors caused by templating syntax. Relates to adrienverge#61, adrienverge#65, adrienverge#128, adrienverge#311, adrienverge#460, adrienverge#462
The real solution is to not use a string templating language to craft structured data. YAML files aren't plain text. They're structured data that has been serialised to a format that can be stored in a file (that happens to still be human editable, for better or worse). You shouldn't rely on a string templating system that has no knowledge of what's being templated to do this properly. This is also how you wind up with cross-site scripting attacks, and it's one reason for why "traditional" stringy HTML templating engines have fallen out of favour, replaced by things like React and Vue. |
We have the following yaml file
But I still get syntax error
Did I miss something ? How can I ignore terraform template syntax
%{ if }...%{ else }...%{ endif }
?P.S.
The text was updated successfully, but these errors were encountered: