Config: Allow overriding only one option when extending

This commit is contained in:
Adrien Vergé
2016-01-19 21:49:58 +01:00
parent fb14cbdbd9
commit ad5cec9c6c
2 changed files with 74 additions and 1 deletions

View File

@@ -46,7 +46,11 @@ def extend_config(content):
if 'extends' in conf:
base = parse_config_from_file(get_extended_conf(conf['extends']))
base.update(conf['rules'])
for rule in conf['rules']:
if type(conf['rules'][rule]) == dict and rule in base:
base[rule].update(conf['rules'][rule])
else:
base[rule] = conf['rules'][rule]
conf['rules'] = base
return conf