Hi,
I want to fix the Ansible Linter issue “[204] Lines should be no longer than 160 chars”.
But how I can linebreak filters?
`
local_filters_in_templates_list: “{{ local_filters_in_templates.files | map(attribute=‘path’) | map(‘regex_replace’,‘^(.*)/’) | map(‘regex_replace’,‘.j2$’) | list }}”
`
simply break after “|”?
Best regards,
Mazorius
Hi,
I want to fix the Ansible Linter issue "*[204]* Lines should be no longer
than 160 chars".
In my opinion the best this is often to disable the to long line check.
But how I can linebreak filters?
local_filters_in_templates_list: "{{ local_filters_in_templates.files |
map(attribute='path') | map('regex_replace','^(.*)/') |
map('regex_replace','.j2$') | list }}"
simply break after "|"?
If you use multiline yaml you can break anywhere you can have a space.
So this is valid
local_filters_in_templates_list: >
{{ local_filters_in_templates.files
>
map(attribute='path')
>
map('regex_replace','^(.*)/')
>
map('regex_replace','.j2$')
>
list }}
Of course this is not very readable, so break it where you like it to be.
And it's important not to use the double quotes when using the multiline, if you do it will be a string and not a list.