Registry / testing / flake8-string-format

flake8-string-format

JSON →
library0.4.0pypypiunverified

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.

pip install flake8 flake8-string-format
INSTALL
IMPORT
SIG · FLAKE8-STRING-FORM
F
flake8-string-format
testingpythonv0.4.0
Install
1.8s avg
Import
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.4.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 19.3MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 1.8s · import 0.000s · 20MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

flake8-string-format
No direct import is typically needed. Flake8 plugins are automatically discovered upon installation.
Users do not import this library directly into their Python code. It extends the functionality of the 'flake8' command-line tool.

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.

# my_module.py def example_function(): message = 'Hello {}'.format('World') # P101: format string does contain unindexed parameters data = {'name': 'Alice'} greeting = 'Hello {name}'.format(**data) # The plugin checks string formatting. To run: # flake8 my_module.py # To ignore a specific error: # flake8 --ignore P101 my_module.py
flake8 --version
Debug
Known issues
breakingVersion 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.
fix
Ensure `flake8` is installed and run the checks using the `flake8` command-line tool.
affects: 0.3.0 and later
gotchaPython 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.
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.
affects: All versions
gotchaError 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.
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.
affects: All versions
Upgrade
Version history
0.4.0latest on PyPI · released Jun 9, 2026
Audit
Dependencies
flake8requiredThis library is a plugin for Flake8 and requires it to function.
Agent activity
11 hits · last 30 days
node
10
Amazon
1
Resources
flake8-string-format — pip install flake8-string-format · libregistry