{ "info": { "author": "Fabian Neundorf", "author_email": "CommodoreFabianus@gmx.de", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Software Development :: Quality Assurance" ], "description": "String format parameter checker\r\n===============================\r\n\r\n.. image:: https://travis-ci.org/xZise/flake8-string-format.svg?branch=0.2.3\r\n :alt: Build Status\r\n :target: https://travis-ci.org/xZise/flake8-string-format\r\n\r\n.. image:: http://codecov.io/github/xZise/flake8-string-format/coverage.svg?branch=master\r\n :alt: Coverage Status\r\n :target: http://codecov.io/github/xZise/flake8-string-format?branch=master\r\n\r\n.. image:: https://badge.fury.io/py/flake8-string-format.svg\r\n :alt: Pypi Entry\r\n :target: https://pypi.python.org/pypi/flake8-string-format\r\n\r\nAn extension for `Flake8 `_ to check the\r\nstrings and parameters using ``str.format``. It checks all strings whether they\r\nuse numbered parameters with an implicit index which isn't support in\r\nPython 2.6.\r\n\r\nIn all instances of ``'\u2026'.format(\u2026)`` it will also check whether there are\r\nenough parameters given. If the format call uses variable arguments, it'll just\r\ncheck whether the right types of arguments are present.\r\n\r\n\r\nStandalone script\r\n-----------------\r\n\r\nThe checker can be used directly::\r\n\r\n $ python -m flake8_string_format some_file.py\r\n some_file.py:1:1: P101 format string does contain unindexed parameters\r\n\r\nEven though Flake8 still uses ``optparse`` this script in standalone mode\r\nis using ``argparse``.\r\n\r\n\r\nPlugin for Flake8\r\n-----------------\r\n\r\nWhen both Flake8 and ``flake8-string-format`` are installed, the plugin\r\nis available in ``flake8``::\r\n\r\n $ flake8 --version\r\n 3.0.2 (flake8-string-format: 0.2.3, [\u2026]\r\n\r\nThis plugin supports Flake8 2.6 as well as Flake8 3.0. Older or newer versions\r\nmay be supported too but they weren't tested.\r\n\r\nVia ``--ignore`` it's possible to ignore unindexed parameters::\r\n\r\n $ flake8 some_file.py\r\n ...\r\n some_file.py:1:1: P101 format string does contain unindexed parameters\r\n\r\n $ flake8 --ignore P101 some_file.py\r\n ...\r\n\r\n\r\nParameters\r\n----------\r\n\r\nThis module doesn't add any additional parameters. The stand alone version also\r\nmimics Flake8's ignore parameter.\r\n\r\n\r\nError codes\r\n-----------\r\n\r\nThis plugin is using the following error codes:\r\n\r\n+--------------------------------------------------------------------+\r\n| Presence of implicit parameters |\r\n+------+-------------------------------------------------------------+\r\n| P101 | format string does contain unindexed parameters |\r\n+------+-------------------------------------------------------------+\r\n| P102 | docstring does contain unindexed parameters |\r\n+------+-------------------------------------------------------------+\r\n| P103 | other string does contain unindexed parameters |\r\n+------+-------------------------------------------------------------+\r\n| Missing values in the parameters |\r\n+------+-------------------------------------------------------------+\r\n| P201 | format call uses to large index (INDEX) |\r\n+------+-------------------------------------------------------------+\r\n| P202 | format call uses missing keyword (KEYWORD) |\r\n+------+-------------------------------------------------------------+\r\n| P203 | format call uses keyword arguments but no named entries |\r\n+------+-------------------------------------------------------------+\r\n| P204 | format call uses variable arguments but no numbered entries |\r\n+------+-------------------------------------------------------------+\r\n| P205 | format call uses implicit and explicit indexes together |\r\n+------+-------------------------------------------------------------+\r\n| Unused values in the parameters |\r\n+------+-------------------------------------------------------------+\r\n| P301 | format call provides unused index (INDEX) |\r\n+------+-------------------------------------------------------------+\r\n| P302 | format call provides unused keyword (KEYWORD) |\r\n+------+-------------------------------------------------------------+\r\n\r\n\r\nOperation\r\n---------\r\n\r\nThe plugin will go through all ``bytes``, ``str`` and ``unicode`` instances. If\r\nit encounters ``bytes`` instances on Python 3, it'll decode them using ASCII and\r\nif that fails it'll skip that entry.\r\n\r\nThe strings are basically sorted into three types corresponding to the P1XX\r\nrange. Only the format string can cause all errors while any other string can\r\nonly cause the corresponding P1XX error.\r\n\r\nFor this plugin all strings which are the first expression of the module or\r\nafter a function or class definition are considered docstrings.\r\n\r\nIf the ``format`` method is used on a string or ``str.format`` with the string\r\nas the first parameter, it will consider this a format string and will analyze\r\nthe parameters of that call. If that call uses variable arguments, it cannot\r\nissue P201 and P202 as missing entries might be hidden in those variable\r\narguments. P301 and P302 can still be checked for any argument which is defined\r\nstatically.\r\n\r\n\r\nPython 2.6 support\r\n``````````````````\r\n\r\nPython 2.6 is only partially supported as it's using Python's capability to\r\nformat a string. So if a string contains implicit parameters, it won't be\r\ndetected as a parameter on Python 2.6 and thus it won't cause any P1XX errors.\r\nBut it might still cause an error P301 when variable arguments aren't used.\r\n\r\nSo if Python 2.6 compatibility is wished and thus implicit parameters aren't\r\nallowed, this plugin won't cause false positives.\r\n\r\n\r\nChanges\r\n-------\r\n\r\n0.2.3 - 2016-07-27\r\n``````````````````\r\n* Properly register with Flake8 so it will be selected on Flake8 3.x by default\r\n and it can be selected on Flake8 2.x.\r\n\r\n0.2.2 - 2016-05-29\r\n``````````````````\r\n* Do not check simple expressions, except for docstrings, because they cannot be\r\n accessed anyway.\r\n* Properly assert starred arguments in Python 3.5. Only the last element must be\r\n a vararg if varargs are present and not the complete list.\r\n* Output correct column offset on Python 3.4.2, as that used the wrong offset\r\n inside calls.\r\n\r\n0.2.1 - 2015-09-20\r\n``````````````````\r\n* Support ``str.format(\"\u2026\", \u2026)`` calls and handle them like ``\"\u2026\".format(\u2026)``\r\n\r\n0.2.0 - 2015-09-12\r\n``````````````````\r\n* Instead of using a regex it's trying to parse it using Python's parser\r\n* This result can also be used now to verify that enough parameters are given\r\n* Limited Python 2.6 support\r\n\r\n0.1.0 - 2015-09-10\r\n``````````````````\r\n* Detect unindexed parameters in all strings\r\n* Separate error code for docstrings", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/xZise/flake8-string-format", "keywords": "flake8 format", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "flake8-string-format", "package_url": "https://pypi.org/project/flake8-string-format/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/flake8-string-format/", "project_urls": { "Homepage": "https://github.com/xZise/flake8-string-format" }, "release_url": "https://pypi.org/project/flake8-string-format/0.2.3/", "requires_dist": [ "flake8" ], "requires_python": "", "summary": "string format checker, plugin for flake8", "version": "0.2.3" }, "last_serial": 2247327, "releases": { "0.2.0": [ { "comment_text": "", "digests": { "md5": "3bd866e71a548d807515793ef39efb8d", "sha256": "2aec48b80dd63410d691b50a305314a80815d91d930c4af6c5ccb0c7b6f859d5" }, "downloads": -1, "filename": "flake8_string_format-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "3bd866e71a548d807515793ef39efb8d", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9625, "upload_time": "2015-09-12T19:17:02", "url": "https://files.pythonhosted.org/packages/81/c3/07ffcad59a51614c9f189bf371b50903c6b107b67d670807df37736ccc38/flake8_string_format-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "240617c35b43afc38a96c2ed6695cbef", "sha256": "d9491c78377858eff1e15f6fd26ee980c7a7dcfe31239cb8d576fe5b5b1255a8" }, "downloads": -1, "filename": "flake8-string-format-0.2.0.tar.gz", "has_sig": false, "md5_digest": "240617c35b43afc38a96c2ed6695cbef", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6856, "upload_time": "2015-09-19T21:20:45", "url": "https://files.pythonhosted.org/packages/11/1e/3f57b9258a21c85cb8374a2278e99a98ebc524c61e459d690d79cf6f8ef2/flake8-string-format-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "7734a9996d69aeec6310e2a05039b799", "sha256": "5a0963baa11c1d4171343a3fd9092afd2e81743dbe422ac46258288c6332d203" }, "downloads": -1, "filename": "flake8_string_format-0.2.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "7734a9996d69aeec6310e2a05039b799", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9799, "upload_time": "2015-09-21T09:05:56", "url": "https://files.pythonhosted.org/packages/43/fd/b8c3f468b6bbcd489ccdc7e0ceb6e74615933fc75adfb0f7f23df87467d7/flake8_string_format-0.2.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "463337b43ceced712363775cfbbba1f6", "sha256": "303aedf165afcefb225674478830ae0ba0c6189cdcb4d88f494f1cd4825375f0" }, "downloads": -1, "filename": "flake8-string-format-0.2.1.tar.gz", "has_sig": false, "md5_digest": "463337b43ceced712363775cfbbba1f6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6962, "upload_time": "2015-09-21T09:06:01", "url": "https://files.pythonhosted.org/packages/d6/3f/36db9190ddb4e0d6ba7bb4b6fe433f8cd6ae8c5a589692d59ec53f643639/flake8-string-format-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "bcdc3a45c708700a14ab9b5840a27c96", "sha256": "3a86faeaa874694c778e5e6c523e54e059556878113b61add8704cd45f4d6090" }, "downloads": -1, "filename": "flake8_string_format-0.2.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "bcdc3a45c708700a14ab9b5840a27c96", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10293, "upload_time": "2016-05-29T11:08:04", "url": "https://files.pythonhosted.org/packages/a5/5f/c6abc7224fe6db8531e6816193be86d3fa656a9df0e915cd9a9d870653bb/flake8_string_format-0.2.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0e75ee5d8176d4d6831663ab952d8d99", "sha256": "0628b4fcfb93e630eab59822a7684d22c395d19d1e08f8be33c8942c49239cf0" }, "downloads": -1, "filename": "flake8-string-format-0.2.2.tar.gz", "has_sig": false, "md5_digest": "0e75ee5d8176d4d6831663ab952d8d99", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7308, "upload_time": "2016-05-29T11:08:12", "url": "https://files.pythonhosted.org/packages/de/84/068be33582b1024ed36fb24d6ae8d87540c48322dbd5d3456eed7472dcc3/flake8-string-format-0.2.2.tar.gz" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "aa1374d3db0bb4af3a1cee59bd052077", "sha256": "68ea72a1a5b75e7018cae44d14f32473c798cf73d75cbaed86c6a9a907b770b2" }, "downloads": -1, "filename": "flake8_string_format-0.2.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "aa1374d3db0bb4af3a1cee59bd052077", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10506, "upload_time": "2016-07-27T17:37:50", "url": "https://files.pythonhosted.org/packages/66/91/82e2958438155bcc9f0f74c625e0d10bdced9fec7d65e54687cdf98a7b59/flake8_string_format-0.2.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1e2077e6c14598af97e321213484a595", "sha256": "774d56103d9242ed968897455ef49b7d6de272000cfa83de5814273a868832f1" }, "downloads": -1, "filename": "flake8-string-format-0.2.3.tar.gz", "has_sig": false, "md5_digest": "1e2077e6c14598af97e321213484a595", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7443, "upload_time": "2016-07-27T17:37:53", "url": "https://files.pythonhosted.org/packages/df/1f/a16f1a1a0b3abf067c56ac7261fd167820bc612f3345eea20a9d57d60e6f/flake8-string-format-0.2.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "aa1374d3db0bb4af3a1cee59bd052077", "sha256": "68ea72a1a5b75e7018cae44d14f32473c798cf73d75cbaed86c6a9a907b770b2" }, "downloads": -1, "filename": "flake8_string_format-0.2.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "aa1374d3db0bb4af3a1cee59bd052077", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10506, "upload_time": "2016-07-27T17:37:50", "url": "https://files.pythonhosted.org/packages/66/91/82e2958438155bcc9f0f74c625e0d10bdced9fec7d65e54687cdf98a7b59/flake8_string_format-0.2.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1e2077e6c14598af97e321213484a595", "sha256": "774d56103d9242ed968897455ef49b7d6de272000cfa83de5814273a868832f1" }, "downloads": -1, "filename": "flake8-string-format-0.2.3.tar.gz", "has_sig": false, "md5_digest": "1e2077e6c14598af97e321213484a595", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7443, "upload_time": "2016-07-27T17:37:53", "url": "https://files.pythonhosted.org/packages/df/1f/a16f1a1a0b3abf067c56ac7261fd167820bc612f3345eea20a9d57d60e6f/flake8-string-format-0.2.3.tar.gz" } ] }