summaryrefslogtreecommitdiffstats
path: root/test/test_config.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_config.py')
-rw-r--r--test/test_config.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/test_config.py b/test/test_config.py
new file mode 100644
index 0000000..51a09b0
--- /dev/null
+++ b/test/test_config.py
@@ -0,0 +1,16 @@
+"""Tests for config module."""
+from ansiblelint.config import PROFILES
+from ansiblelint.rules import RulesCollection
+
+
+def test_profiles(default_rules_collection: RulesCollection) -> None:
+ """Test the rules included in profiles are valid."""
+ profile_banned_tags = {"opt-in", "experimental"}
+ for name, data in PROFILES.items():
+ for profile_rule_id in data["rules"]:
+ for rule in default_rules_collection.rules:
+ if profile_rule_id == rule.id:
+ forbidden_tags = profile_banned_tags & set(rule.tags)
+ assert (
+ not forbidden_tags
+ ), f"Rule {profile_rule_id} from {name} profile cannot use {profile_banned_tags & set(rule.tags)} tag."