|
|
@ -83,10 +83,16 @@ def parse_config(content):
|
|
|
|
raise YamlLintConfigError(
|
|
|
|
raise YamlLintConfigError(
|
|
|
|
'invalid config: unknown option "%s" for rule "%s"' %
|
|
|
|
'invalid config: unknown option "%s" for rule "%s"' %
|
|
|
|
(optkey, id))
|
|
|
|
(optkey, id))
|
|
|
|
if type(conf['rules'][id][optkey]) != options[optkey]:
|
|
|
|
if type(options[optkey]) == tuple:
|
|
|
|
raise YamlLintConfigError(
|
|
|
|
if conf['rules'][id][optkey] not in options[optkey]:
|
|
|
|
'invalid config: option "%s" of "%s" should be %s' %
|
|
|
|
raise YamlLintConfigError(
|
|
|
|
(optkey, id, options[optkey].__name__))
|
|
|
|
('invalid config: option "%s" of "%s" should be '
|
|
|
|
|
|
|
|
'in %s') % (optkey, id, options[optkey]))
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
if type(conf['rules'][id][optkey]) != options[optkey]:
|
|
|
|
|
|
|
|
raise YamlLintConfigError(
|
|
|
|
|
|
|
|
('invalid config: option "%s" of "%s" should be '
|
|
|
|
|
|
|
|
'%s' % (optkey, id, options[optkey].__name__)))
|
|
|
|
rules[id][optkey] = conf['rules'][id][optkey]
|
|
|
|
rules[id][optkey] = conf['rules'][id][optkey]
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
raise YamlLintConfigError(('invalid config: rule "%s": should be '
|
|
|
|
raise YamlLintConfigError(('invalid config: rule "%s": should be '
|
|
|
|