def METHOD_NAME(cfg: Union[str, Config], check=True) -> List[Exception]:
    from promnesia.__main__ import _do_index
    with with_config(cfg):
        errors = list(_do_index())
        if check:
            assert len(errors) == 0, errors
        # visits = cfg.output_dir / 'promnesia.sqlite'
        # TODO query visit count too
        return errors