fix(config): Be clearer about the `ignore` conf type

pull/60/merge
Adrien Vergé 8 years ago
parent d99bb9fec3
commit f4edb85a04

@ -87,7 +87,7 @@ class YamlLintConfig(object):
if 'ignore' in conf: if 'ignore' in conf:
if type(conf['ignore']) != str: if type(conf['ignore']) != str:
raise YamlLintConfigError( raise YamlLintConfigError(
'invalid config: ignore should be a list of patterns') 'invalid config: ignore should contain file patterns')
self.ignore = pathspec.PathSpec.from_lines( self.ignore = pathspec.PathSpec.from_lines(
'gitwildmatch', conf['ignore'].splitlines()) 'gitwildmatch', conf['ignore'].splitlines())
@ -112,7 +112,7 @@ def validate_rule_conf(rule, conf):
type(conf['ignore']) != pathspec.pathspec.PathSpec): type(conf['ignore']) != pathspec.pathspec.PathSpec):
if type(conf['ignore']) != str: if type(conf['ignore']) != str:
raise YamlLintConfigError( raise YamlLintConfigError(
'invalid config: ignore should be a list of patterns') 'invalid config: ignore should contain file patterns')
conf['ignore'] = pathspec.PathSpec.from_lines( conf['ignore'] = pathspec.PathSpec.from_lines(
'gitwildmatch', conf['ignore'].splitlines()) 'gitwildmatch', conf['ignore'].splitlines())

Loading…
Cancel
Save