Skip to content

Commit 5fc07eb

Browse files
committed
Use f-string
1 parent 2a41b7f commit 5fc07eb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

protovalidate/internal/rules.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,14 +417,14 @@ def validate(self, ctx: RuleContext, msg: message.Message):
417417
ctx.add(
418418
Violation(
419419
rule_id="message.oneof",
420-
message="only one of {} can be set".format(", ".join([field.name for field in self._fields])),
420+
message=f"only one of {", ".join([field.name for field in self._fields])} can be set",
421421
)
422422
)
423423
if self._required and num_set_fields == 0:
424424
ctx.add(
425425
Violation(
426426
rule_id="message.oneof",
427-
message="one of {} must be set".format(", ".join([field.name for field in self._fields])),
427+
message=f"one of {", ".join([field.name for field in self._fields])} must be set",
428428
)
429429
)
430430

0 commit comments

Comments
 (0)