File tree Expand file tree Collapse file tree 1 file changed +5
-14
lines changed
Expand file tree Collapse file tree 1 file changed +5
-14
lines changed Original file line number Diff line number Diff line change 66from itertools import chain
77from pathlib import Path
88from typing import TypeAlias , TypedDict , TypeVar , cast
9- from warnings import showwarning as warn
109
1110from proselint import config
1211from proselint .config import paths
@@ -81,19 +80,11 @@ def load_from(config_path: Path | None = None) -> Config:
8180 result = DEFAULT
8281 config_paths = paths .config_paths + ([config_path ] if config_path else [])
8382
84- for path in config_paths :
85- if path .is_file ():
86- result = _deepmerge_dicts (
87- cast ("dict[str, object]" , result ),
88- json .loads (path .read_text ()), # pyright: ignore[reportAny]
89- )
90- if path .suffix == ".json" and (old := path .with_suffix ("" )).is_file ():
91- warn (
92- f"{ old } was found instead of a JSON file. Rename to { path } ." ,
93- DeprecationWarning ,
94- "" ,
95- 0 ,
96- )
83+ for path in filter (Path .is_file , config_paths ):
84+ result = _deepmerge_dicts (
85+ cast ("dict[str, object]" , result ),
86+ json .loads (path .read_text ()), # pyright: ignore[reportAny]
87+ )
9788
9889 result = cast ("Config" , result )
9990
You can’t perform that action at this time.
0 commit comments