{ "info": { "author": "Vitaliy Kharitonskiy", "author_email": "gil.gnome@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v2 (GPLv2)", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Software Development :: Quality Assurance" ], "description": ".. -*- coding: utf-8 -*-\n\nFlake8 i18n plugin\n==========================\nWay too often using gettext in python results in one of\nthe following errors:\n\n_(f\"{context_variable}\")\n\nNot only gettext will not work here because fstring interpolation\nhappens before function call, but using gettext tools for collecting\ntranslation keys results in:\n\n File \"/usr/lib/python3.6/site-packages/babel/messages/extract.py\",\n\n line 480, in extract_python\n value = eval(code, {'__builtins__': {}}, {})\n\n File \"\", line 2, in \n NameError: name 'context_variable' is not defined\n\nSimilar cases are\n _(\"%s\" % value)\nand\n _(\"{}\".format(value))\n\nwhich will not trigger a collection error,\nbut will still result in an incorrect key name in gettext function call.\n\nThis flake8 extensions provides basic checks for the above cases.\n\n\nInstall\n-------\nInstall with pip::\n\n $ pip install flake8-i18n\n\nConfigure\n---------\n\nAdd following into your .flake8 file\n\n i18nfuncs =\n gettext\n ngettext\n myfunny_gettext\n _\n\nOtherwise the default function name list is\n gettext\n ngettext\n _\n\n\nUsing string interpolation inside gettext will now result in one of the following:\n\n I001 fstring is resolved before function call\n\n I002 format is resolved before function call\n\n I003 printf is resolved before function call\n\n\nRequirements\n------------\n- Python 3.6, 3.7\n- flake8\n\n\nLicense\n-------\nGNU General Public License v2 (GPLv2)\n\n.. -*- coding: utf-8 -*-\n\nChangelog\n=========\n\n0.1.0 (2019-03-02)\n------------------\n\n- Basic implementation", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/vharitonsky/flake8-i18n", "keywords": "pep8 flake8 i18n", "license": "Free", "maintainer": "", "maintainer_email": "", "name": "flake8-i18n", "package_url": "https://pypi.org/project/flake8-i18n/", "platform": "", "project_url": "https://pypi.org/project/flake8-i18n/", "project_urls": { "Homepage": "https://github.com/vharitonsky/flake8-i18n" }, "release_url": "https://pypi.org/project/flake8-i18n/0.1.0/", "requires_dist": null, "requires_python": "", "summary": "Warns about incorrect gettext usage.", "version": "0.1.0" }, "last_serial": 4890367, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "5a5bfae195f42dc28dc9628cd653bb91", "sha256": "6f17e780cb302b8532558d71abf0c99ca5fcc8df3e53ed34c74f0066404d466b" }, "downloads": -1, "filename": "flake8-i18n-0.1.0.tar.gz", "has_sig": false, "md5_digest": "5a5bfae195f42dc28dc9628cd653bb91", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3381, "upload_time": "2019-03-03T08:57:52", "url": "https://files.pythonhosted.org/packages/44/94/8120dfcc8b94c1926c82aa6f36aebcef92a827434bd073f0f1c6c5fe0213/flake8-i18n-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5a5bfae195f42dc28dc9628cd653bb91", "sha256": "6f17e780cb302b8532558d71abf0c99ca5fcc8df3e53ed34c74f0066404d466b" }, "downloads": -1, "filename": "flake8-i18n-0.1.0.tar.gz", "has_sig": false, "md5_digest": "5a5bfae195f42dc28dc9628cd653bb91", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3381, "upload_time": "2019-03-03T08:57:52", "url": "https://files.pythonhosted.org/packages/44/94/8120dfcc8b94c1926c82aa6f36aebcef92a827434bd073f0f1c6c5fe0213/flake8-i18n-0.1.0.tar.gz" } ] }