From 9d46b6a7b06d09adca6c7136a46abd67554e7e4a Mon Sep 17 00:00:00 2001 From: Athanasius Date: Mon, 7 Jun 2021 12:58:45 +0100 Subject: [PATCH] Contributing: .format() still acceptable wrt translations --- Contributing.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Contributing.md b/Contributing.md index 3009a086..e1086de7 100644 --- a/Contributing.md +++ b/Contributing.md @@ -380,11 +380,16 @@ In addition to that we utilise one of the user-defined levels as: ## Use fstrings, not modulo-formatting or .format -[fstrings](https://www.python.org/dev/peps/pep-0498/) are new in python 3.6, and allow for string interpolation rather -than more opaque formatting calls. +[fstrings](https://www.python.org/dev/peps/pep-0498/) are new in python 3.6, +and allow for string interpolation rather than more opaque formatting calls. -As part of our flake8 linting setup we have included a linter that warns when you use either `%` or `.format` on string -literals. +As part of our flake8 linting setup we have included a linter that warns when +you use `%` on string literals. + +`.format()` won't throw flake8 errors, **but only because it's still the +best way to handle [untranslated words](./docs/Translations.md#call-_) +in otherwise translated phrases**. Thus, we allow this, and only this, use of +`.format()` for strings. ---