Tests: cli: Detect and handle the -d '' case
This commit is contained in:
@@ -88,7 +88,7 @@ def run(argv=None):
|
||||
|
||||
try:
|
||||
if args.config_data is not None:
|
||||
if ':' not in args.config_data:
|
||||
if args.config_data != '' and ':' not in args.config_data:
|
||||
args.config_data = 'extends: ' + args.config_data
|
||||
conf = YamlLintConfig(content=args.config_data)
|
||||
elif args.config_file is not None:
|
||||
|
||||
@@ -59,6 +59,9 @@ class YamlLintConfig(object):
|
||||
except Exception as e:
|
||||
raise YamlLintConfigError('invalid config: %s' % e)
|
||||
|
||||
if type(conf) != dict:
|
||||
raise YamlLintConfigError('invalid config: not a dict')
|
||||
|
||||
self.rules = conf.get('rules', {})
|
||||
|
||||
# Does this conf override another conf that we need to load?
|
||||
|
||||
Reference in New Issue
Block a user