Skip to content

Commit 84366fb

Browse files
author
Yuki Kobayashi
committed
Add error check for invalid config
1 parent 2d10aaa commit 84366fb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

yamllint/config.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ def parse(self, raw_content):
8282
raise YamlLintConfigError('invalid config: not a dict')
8383

8484
self.rules = conf.get('rules', {})
85+
if not isinstance(self.rules, dict):
86+
raise YamlLintConfigError('invalid config: rules should be a dict')
8587
for rule in self.rules:
8688
if self.rules[rule] == 'enable':
8789
self.rules[rule] = {}

0 commit comments

Comments
 (0)