1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-18 09:57:40 +03:00

Contributing: .format() still acceptable wrt translations

This commit is contained in:
Athanasius 2021-06-07 12:58:45 +01:00
parent d304c32602
commit 9d46b6a7b0

View File

@ -380,11 +380,16 @@ In addition to that we utilise one of the user-defined levels as:
## Use fstrings, not modulo-formatting or .format ## 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 [fstrings](https://www.python.org/dev/peps/pep-0498/) are new in python 3.6,
than more opaque formatting calls. 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 As part of our flake8 linting setup we have included a linter that warns when
literals. 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.
--- ---