File tree Expand file tree Collapse file tree 2 files changed +6
-18
lines changed
Expand file tree Collapse file tree 2 files changed +6
-18
lines changed Original file line number Diff line number Diff line change @@ -200,10 +200,7 @@ This will return a list of suggestions:
200200
201201You can disable any of the checks by modifying
202202` $XDG_CONFIG_HOME/proselint/config.json` . If `$XDG_CONFIG_HOME` is not set or
203- empty, `~/.config/proselint/config.json` will be used. Additionally, for
204- compatibility reasons, the legacy configurations `~/.proselintrc` and
205- ` $XDG_CONFIG_HOME/proselint/config` will be checked if
206- ` $XDG_CONFIG_HOME/proselint/config.json` does not exist. Check selection is
203+ empty, `~/.config/proselint/config.json` will be used. Check selection is
207204granular at any level, illustrated in the following example :
208205
209206` ` ` json
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