Skip to content

Commit fe5c241

Browse files
committed
fix: direct .format() usage in exception messages
src/vcspull/_internal/config_reader.py:49:39: EM102 [*] Exception must not use an f-string literal, assign to variable first src/vcspull/_internal/config_reader.py:112:39: EM102 [*] Exception must not use an f-string literal, assign to variable first src/vcspull/_internal/config_reader.py:187:39: EM102 [*] Exception must not use an f-string literal, assign to variable first Found 3 errors.
1 parent 28ca345 commit fe5c241

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/vcspull/_internal/config_reader.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ def _load(format: "FormatLiteral", content: str) -> dict[str, t.Any]:
4646
elif format == "json":
4747
return t.cast(dict[str, t.Any], json.loads(content))
4848
else:
49-
raise NotImplementedError(f"{format} not supported in configuration")
49+
msg = f"{format} not supported in configuration"
50+
raise NotImplementedError(msg)
5051

5152
@classmethod
5253
def load(cls, format: "FormatLiteral", content: str) -> "ConfigReader":
@@ -109,7 +110,8 @@ def _from_file(cls, path: pathlib.Path) -> dict[str, t.Any]:
109110
elif path.suffix == ".json":
110111
format = "json"
111112
else:
112-
raise NotImplementedError(f"{path.suffix} not supported in {path}")
113+
msg = f"{path.suffix} not supported in {path}"
114+
raise NotImplementedError(msg)
113115

114116
return cls._load(
115117
format=format,
@@ -184,7 +186,8 @@ def _dump(
184186
indent=2,
185187
)
186188
else:
187-
raise NotImplementedError(f"{format} not supported in config")
189+
msg = f"{format} not supported in config"
190+
raise NotImplementedError(msg)
188191

189192
def dump(self, format: "FormatLiteral", indent: int = 2, **kwargs: t.Any) -> str:
190193
r"""Dump via ConfigReader instance.

0 commit comments

Comments
 (0)