Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False positive STR100 inspection on gettext calls #164

Open
RaphaelKimmig opened this issue Oct 28, 2020 · 0 comments
Open

False positive STR100 inspection on gettext calls #164

RaphaelKimmig opened this issue Oct 28, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@RaphaelKimmig
Copy link

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
@RaphaelKimmig RaphaelKimmig added the bug Something isn't working label Oct 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant