<reponame>bigmanu/ansibletower<filename>collections/ansible_collections/pulp/pulp_installer/forklift/rules/TaskVariableHasSpace.py<gh_stars>0
from ansiblelint import AnsibleLintRule

import re

class TaskVariableHasSpace(AnsibleLintRule):
    id = 'E305'
    shortdesc = 'Variables should be enclosed by spaces "{{ foo }}"'
    description = ''
    tags = ['task']

    compiled = re.compile(r'{{(\w*)}}')

    def match(self, file, text):
        m = self.compiled.search(text)
        if m:
            return True
        return False
