MichaelKim0407 / flake8-use-fstring

MIT License
51 stars 7 forks source link

Support django translation and python-brace-format #27

Open sshishov opened 2 years ago

sshishov commented 2 years ago

Before you request a new feature, please confirm: [+] I have read through README and understand how the plugin works currently. [+] I understand that this project is not actively adding new features, and there are no promises if/when my request will be implemented. [+] (Optional) I am interested in working to add this feature through a PR.

What would you like to see added to this plugin? I would like to add the support for the django translations which uses python-brace-format

What is your rationale/ use case for this feature? Currently it is producing false-positive result and adding noqa all over the places is not a great solution. Disabling the error in the plugin is not also the proper way of doing as sometimes it is pointing out to the developer that he forgot to add the f prefix for the string.

What alternative solutions have you considered? Why do you prefer the solution you proposed? There is no solution except just disabling FS003 error

Additional relevant information: Example of the usage

from django.utils.translation import gettext

value = gettext('some string with {param} here').format(param=param)

It is needed to support lazy translation the string with parameter, do not like the current solution which is using % (old) format syntax.

MichaelKim0407 commented 2 years ago

Thanks for making this suggestion.

Could you please explain what you would like implemented? It looks to me that you described a case where this plugin doesn't work well, but didn't specify how you want it to work.