Skip to content

Commit

Permalink
Fixes false positive with deprecated-bare-vars (#1583)
Browse files Browse the repository at this point in the history
Fixes: #2020
  • Loading branch information
ssbarnea committed May 24, 2021
1 parent 33a7905 commit 7169480
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions examples/playbooks/using-bare-variables-success.yml
Expand Up @@ -158,3 +158,10 @@
debug:
msg: "{{ item }}"
with_inventory_hostnames: all

- name: test more complex jinja is also allowed
debug:
msg: "{{ item }}"
with_items: >-
{%- set ns = [1, 1, 2] -%}
{{- ns.keys | unique -}}
Expand Up @@ -42,7 +42,7 @@ class UsingBareVariablesIsDeprecatedRule(AnsibleLintRule):
tags = ['deprecations']
version_added = 'historic'

_jinja = re.compile(r"{{.*}}", re.DOTALL)
_jinja = re.compile(r"{[{%].*[%}]}", re.DOTALL)
_glob = re.compile('[][*?]')

def matchtask(
Expand Down

0 comments on commit 7169480

Please sign in to comment.