summaryrefslogtreecommitdiffstats
path: root/test/rules/fixtures/ematcher.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 12:06:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 12:06:49 +0000
commit2fe34b6444502079dc0b84365ce82dbc92de308e (patch)
tree8fedcab52bbbc3db6c5aa909a88a7a7b81685018 /test/rules/fixtures/ematcher.py
parentInitial commit. (diff)
downloadansible-lint-2fe34b6444502079dc0b84365ce82dbc92de308e.tar.xz
ansible-lint-2fe34b6444502079dc0b84365ce82dbc92de308e.zip
Adding upstream version 6.17.2.upstream/6.17.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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