Skip to content

Commit 603e7e3

Browse files
committed
style: run ruff format
1 parent a57ea5b commit 603e7e3

File tree

2 files changed

+15
-18
lines changed

2 files changed

+15
-18
lines changed

proselint/config/__init__.py

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ class Config(TypedDict):
2626

2727

2828
DEFAULT = cast(
29-
"Config",
30-
json.loads((files(config) / "default.json").read_text())
29+
"Config", json.loads((files(config) / "default.json").read_text())
3130
)
3231

3332
Checks: TypeAlias = Mapping[str, "bool | Checks"]
@@ -36,7 +35,7 @@ class Config(TypedDict):
3635

3736

3837
def _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
)

tests/test_registry.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@
88

99
def test_specific_overrides_general() -> None:
1010
"""Test that specific config keys override general ones."""
11-
checks = _sort_by_specificity({
12-
"typography": True,
13-
"typography.symbols": False,
14-
"typography.symbols.curly_quotes": True,
15-
"typography.punctuation.hyperbole": False,
16-
})
11+
checks = _sort_by_specificity(
12+
{
13+
"typography": True,
14+
"typography.symbols": False,
15+
"typography.symbols.curly_quotes": True,
16+
"typography.punctuation.hyperbole": False,
17+
}
18+
)
1719

1820
registry = CheckRegistry()
1921
enabled = registry.get_all_enabled(checks)

0 commit comments

Comments
 (0)