@@ -26,8 +26,7 @@ class Config(TypedDict):
2626
2727
2828DEFAULT = cast (
29- "Config" ,
30- json .loads ((files (config ) / "default.json" ).read_text ())
29+ "Config" , json .loads ((files (config ) / "default.json" ).read_text ())
3130)
3231
3332Checks : TypeAlias = Mapping [str , "bool | Checks" ]
@@ -36,7 +35,7 @@ class Config(TypedDict):
3635
3736
3837def _deepmerge_dicts (
39- base : dict [KT_co , VT_co ], overrides : dict [KT_co , VT_co ]
38+ base : dict [KT_co , VT_co ], overrides : dict [KT_co , VT_co ]
4039) -> dict [KT_co , VT_co ]:
4140 # fmt: off
4241 return base | overrides | {
@@ -50,14 +49,10 @@ def _deepmerge_dicts(
5049 }
5150
5251
53- def _flatten_checks (
54- checks : Checks , prefix : str = ""
55- ) -> dict [str , bool ]:
52+ def _flatten_checks (checks : Checks , prefix : str = "" ) -> dict [str , bool ]:
5653 return dict (
5754 chain .from_iterable (
58- _flatten_checks (
59- cast ("Mapping[str, bool]" , value ), full_key
60- ).items ()
55+ _flatten_checks (cast ("Mapping[str, bool]" , value ), full_key ).items ()
6156 if isinstance (value , dict )
6257 else [(full_key , bool (value ))]
6358 for key , value in checks .items ()
@@ -102,7 +97,7 @@ def load_from(config_path: Path | None = None) -> Config:
10297
10398 return Config (
10499 max_errors = cast ("int" , result .get ("max_errors" , 0 )),
105- checks = _sort_by_specificity (_flatten_checks (
106- cast ("dict[str, bool]" , result .get ("checks" , {}))
107- )) ,
100+ checks = _sort_by_specificity (
101+ _flatten_checks ( cast ("dict[str, bool]" , result .get ("checks" , {}) ))
102+ ),
108103 )
0 commit comments