summaryrefslogtreecommitdiffstats
path: root/test/rules/fixtures/ematcher.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/rules/fixtures/ematcher.py')
-rw-r--r--test/rules/fixtures/ematcher.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/rules/fixtures/ematcher.py b/test/rules/fixtures/ematcher.py
new file mode 100644
index 0000000..1b04b6b
--- /dev/null
+++ b/test/rules/fixtures/ematcher.py
@@ -0,0 +1,15 @@
+"""Custom rule used as fixture."""
+from ansiblelint.rules import AnsibleLintRule
+
+
+class EMatcherRule(AnsibleLintRule):
+ """BANNED string found."""
+
+ id = "TEST0001"
+ description = (
+ "This is a test custom rule that looks for lines containing BANNED string"
+ )
+ tags = ["fake", "dummy", "test1"]
+
+ def match(self, line: str) -> bool:
+ return "BANNED" in line