general: update mypy config, seems that logs of type: ignore aren't necessary anymore

This commit is contained in:
Dima Gerasimov 2023-05-15 21:53:33 +01:00 committed by karlicoss
parent a445d2cbfe
commit c34656e8fb
52 changed files with 142 additions and 105 deletions

View file

@ -7,16 +7,16 @@ from typing import Sequence, Optional
from . import warnings, PathIsh, Path
try:
from my.config import core as user_config # type: ignore[attr-defined]
from my.config import core as user_config # type: ignore[attr-defined]
except Exception as e:
try:
from my.config import common as user_config # type: ignore[attr-defined, assignment, misc]
from my.config import common as user_config # type: ignore[attr-defined]
warnings.high("'common' config section is deprecated. Please rename it to 'core'.")
except Exception as e2:
# make it defensive, because it's pretty commonly used and would be annoying if it breaks hpi doctor etc.
# this way it'll at least use the defaults
# todo actually not sure if needs a warning? Perhaps it's okay without it, because the defaults are reasonable enough
user_config = object # type: ignore[assignment, misc]
user_config = object
_HPI_CACHE_DIR_DEFAULT = ''