pycharm-security
pycharm-security copied to clipboard
False positive STR100 inspection on gettext calls
When using string.format with the result of gettext calls the STR100 inspection "Calling format with insecure string" is triggered.
The snippet below triggers the inspection:
from django.utils.translation import gettext as _
def greet(person):
return _("Hello {name}").format(name=person)
I would expect the inspection not to flag static strings passed through gettext (and gettext_lazy) as the usage above is consistent with djangos internal usage.
- Plugin version is 1.22.1
- PyCharm version is 220.2.3