core.warnings: handle stacklevel properly

add more warnings about deprecated config arguments
This commit is contained in:
Dima Gerasimov 2020-09-27 18:00:19 +02:00 committed by karlicoss
parent 109edd9da3
commit abbaa47aaf
4 changed files with 18 additions and 12 deletions

View file

@ -43,8 +43,11 @@ class github(user_config):
from ..core.cfg import make_config, Attrs
def migration(attrs: Attrs) -> Attrs:
if 'export_dir' in attrs: # legacy name
attrs['export_path'] = attrs['export_dir']
export_dir = 'export_dir'
if export_dir in attrs: # legacy name
attrs['export_path'] = attrs[export_dir]
from ..core.warnings import high
high(f'"{export_dir}" is deprecated! Please use "export_path" instead."')
return attrs
config = make_config(github, migration=migration)