doctor: warn if the default config is used
This commit is contained in:
parent
f40b804833
commit
2619af7ae7
1 changed files with 14 additions and 2 deletions
|
@ -131,9 +131,21 @@ def config_check(args):
|
|||
except Exception as e:
|
||||
error("failed to import the config")
|
||||
tb(e)
|
||||
sys.exit(1)
|
||||
sys.exit(1) # todo yield exception here? so it doesn't fail immediately..
|
||||
|
||||
info(f"config file: {cfg.__file__}")
|
||||
cfg_path = cfg.__file__# todo might be better to use __path__?
|
||||
info(f"config file: {cfg_path}")
|
||||
|
||||
import my.core as core
|
||||
try:
|
||||
core_pkg_path = str(Path(core.__path__[0]).parent) # type: ignore[attr-defined]
|
||||
if cfg_path.startswith(core_pkg_path):
|
||||
error(f'''
|
||||
Seems that the default config is used ({cfg_path}).
|
||||
See https://github.com/karlicoss/HPI/blob/master/doc/SETUP.org#setting-up-modules for more information
|
||||
'''.strip())
|
||||
except Exception as e:
|
||||
tb(e)
|
||||
|
||||
mres = run_mypy(cfg)
|
||||
if mres is None: # no mypy
|
||||
|
|
Loading…
Add table
Reference in a new issue