Skip to content

Commit 9ce2a16

Browse files
committed
chore: parenthesize implicit string concatenations in validation messages
The repo-wide ruff-check pre-commit hook fails on three unparenthesized implicit string concatenations inside list literals in the effort-level validation messages, blocking every commit. Wrapping each concatenated message in parentheses keeps the intended single-string semantics and satisfies the rule.
1 parent d6e315f commit 9ce2a16

1 file changed

Lines changed: 13 additions & 7 deletions

File tree

scripts/models/environment_config.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,10 @@ def _validate_effort_level_entry(effort_level: object, model: object) -> list[st
242242
"""
243243
if effort_level not in EFFORT_LEVEL_VALUES:
244244
return [
245-
f'user-settings.effortLevel must be one of '
246-
f'{sorted(EFFORT_LEVEL_VALUES)}, got {effort_level!r}.',
245+
(
246+
f'user-settings.effortLevel must be one of '
247+
f'{sorted(EFFORT_LEVEL_VALUES)}, got {effort_level!r}.'
248+
),
247249
]
248250

249251
if effort_level not in ('xhigh', 'max'):
@@ -254,18 +256,22 @@ def _validate_effort_level_entry(effort_level: object, model: object) -> list[st
254256

255257
if not isinstance(model, str) or not model.strip():
256258
return [
257-
f"user-settings.effortLevel '{effort_level}' requires user-settings.model "
258-
f'to be specified. This effort level is only available for {families}.',
259+
(
260+
f"user-settings.effortLevel '{effort_level}' requires user-settings.model "
261+
f'to be specified. This effort level is only available for {families}.'
262+
),
259263
]
260264

261265
model_lower = model.lower()
262266
# The 'best' alias is matched exactly, not as a substring, so arbitrary
263267
# model names that merely contain 'best' are not accepted.
264268
if model_lower != 'best' and not any(marker in model_lower for marker in markers):
265269
return [
266-
f"user-settings.effortLevel '{effort_level}' is only available for "
267-
f"{families}, but model is set to '{model}'. "
268-
"Use 'low', 'medium', or 'high' for other models.",
270+
(
271+
f"user-settings.effortLevel '{effort_level}' is only available for "
272+
f"{families}, but model is set to '{model}'. "
273+
"Use 'low', 'medium', or 'high' for other models."
274+
),
269275
]
270276

271277
return []

0 commit comments

Comments
 (0)