diff --git a/codespell_lib/_codespell.py b/codespell_lib/_codespell.py index ae6bc37025..017a383d20 100644 --- a/codespell_lib/_codespell.py +++ b/codespell_lib/_codespell.py @@ -952,7 +952,7 @@ def parse_file( if options.write_changes and fix: changed = True - lines[i] = re.sub(r"\b%s\b" % word, fixword, lines[i]) + lines[i] = re.sub(rf"\b{word}\b", fixword, lines[i]) fixed_words.add(word) continue