summaryrefslogtreecommitdiffstats
path: root/test/rules/fixtures/unset_variable_matcher.py
blob: ea8b0c036cea0fe5e0d8dab5ed51b654f12a5190 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
"""Custom linting rule used as test fixture."""

from ansiblelint.rules import AnsibleLintRule


class UnsetVariableMatcherRule(AnsibleLintRule):
    """Line contains untemplated variable."""

    id = "TEST0002"
    description = (
        "This is a test rule that looks for lines post templating that still contain {{"
    )
    tags = ["fake", "dummy", "test2"]

    def match(self, line: str) -> bool:
        return "{{" in line