{"id":8167,"library":"flake8-string-format","title":"Flake8 String Format Checker","description":"An extension for Flake8 that enforces best practices for `str.format` usage. It identifies various issues such as unindexed parameters, insufficient arguments in format calls, mixed implicit and explicit indexing, and unused arguments. The current version, 0.3.0, was released in February 2020, indicating a maintenance release cadence focusing on stability rather than frequent updates.","status":"maintenance","version":"0.3.0","language":"python","source_language":"en","source_url":"https://github.com/xZise/flake8-string-format","tags":["flake8-plugin","linting","code-quality","string-formatting","python-2-compatibility"],"install":[{"cmd":"pip install flake8 flake8-string-format","lang":"bash","label":"Install with pip"}],"dependencies":[{"reason":"This library is a plugin for Flake8 and requires it to function.","package":"flake8","optional":false}],"imports":[{"note":"Users do not import this library directly into their Python code. It extends the functionality of the 'flake8' command-line tool.","symbol":"flake8-string-format","correct":"No direct import is typically needed. Flake8 plugins are automatically discovered upon installation."}],"quickstart":{"code":"# my_module.py\ndef example_function():\n    message = 'Hello {}'.format('World') # P101: format string does contain unindexed parameters\n    data = {'name': 'Alice'}\n    greeting = 'Hello {name}'.format(**data)\n    # The plugin checks string formatting. To run:\n    # flake8 my_module.py\n    # To ignore a specific error:\n    # flake8 --ignore P101 my_module.py","lang":"python","description":"After installation, `flake8-string-format` automatically integrates with Flake8. Simply run `flake8` on your project. The plugin will report errors using codes like P101 (unindexed parameters), P201 (missing arguments), and P301 (unused arguments). Errors can be ignored using the `--ignore` flag or by configuring your `.flake8` file."},"warnings":[{"fix":"Ensure `flake8` is installed and run the checks using the `flake8` command-line tool.","message":"Version 0.3.0 removed support for running `flake8-string-format` as a standalone tool. It must now be used exclusively as a plugin for Flake8.","severity":"breaking","affected_versions":"0.3.0 and later"},{"fix":"For full compatibility checks and consistent behavior, use Python 2.7+ or Python 3. For Python 2.6, be aware of the limitations regarding implicit parameter detection.","message":"Python 2.6 support is partial. The plugin may not detect implicit parameters as errors (P1XX) on Python 2.6, but might still report P301 if variable arguments are unused.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Consider ignoring P102 and P103 by default using `--ignore P102,P103` in your `flake8` configuration, unless your project specifically targets Python 2.6 with a strict no-unindexed-parameters policy for all strings.","message":"Error codes P102 ('docstring does contain unindexed parameters') and P103 ('other string does contain unindexed parameters') are prone to false positives and are generally recommended only for Python 2.6 projects where unindexed parameters are strictly forbidden.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"search_vec":"'-2':69 '0.3.0':40 '2020':45 'argument':25,36 'best':11 'cadenc':50 'call':28 'checker':4 'code':63 'code-qu':62 'compat':70 'current':38 'enforc':10 'explicit':32 'extens':6 'februari':44 'flake8':1,8,59 'flake8-plugin':58 'focus':51 'format':3,27,67 'frequent':56 'identifi':17 'implicit':30 'index':33 'indic':46 'insuffici':24 'issu':19 'lint':61 'mainten':48 'mix':29 'paramet':23 'plugin':60 'practic':12 'python':68 'qualiti':64 'rather':54 'releas':42,49 'stabil':53 'str.format':14 'string':2,66 'string-format':65 'unindex':22 'unus':35 'updat':57 'usag':15 'various':18 'version':39","created_at":"2026-04-16T17:00:46.566725+00:00","updated_at":"2026-04-16T17:00:46.566725+00:00","problems":{"verify_error":"no import statement found"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.4.0","cli_name":"flake8","cli_version":"7.3.0 (flake8-string-format: 0.3.0, mccabe: 0.7.0, pycodestyle: 2.14.0,","type":"library","homepage":null,"github":"https://github.com/xZise/flake8-string-format","docs":null,"changelog":null,"pypi":"https://pypi.org/project/flake8-string-format/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"skip","verified_at":"2026-06-28","last_verified":"2026-06-28","next_check":"2026-07-05","install_tag":null}}