summaryrefslogtreecommitdiffstats
path: root/test/rules/fixtures/unset_variable_matcher.py
blob: c2b174411ebe811ddcfb716519af8813695bb3d5 (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