skillfed

flake8-string-format

string format checker, plugin for flake8

flake8-string-format v0.4.0 170.8K downloads/30d#10,385 on PyPI20
Permissive license MIT Active released

What it is and what it does

flake8-string-format is a Flake8 linter plugin that analyzes all string format operations in your code and reports errors when format calls don't match their arguments. It detects unindexed parameters (which fail in Python 2.6), mismatched argument counts, unused parameters, and mixing of implicit and explicit indexing. The plugin integrates directly into Flake8's error reporting and can be controlled via standard Flake8 ignore flags.

It works by parsing format strings and their corresponding format() calls, checking whether the parameters referenced in the string actually exist in the call's arguments. It distinguishes between format strings (where format() is called), docstrings, and plain strings, issuing different error codes for each context. The plugin handles variable arguments gracefully by skipping checks that would be unreliable when *args or **kwargs are present.

Use it for:

  • Catch format string bugs during CI/CD by detecting mismatched argument counts before runtime
  • Enforce Python 2.6 compatibility by flagging unindexed parameters like '{}'.format(x)
  • Identify unused parameters passed to format() calls, reducing confusion and maintenance burden
  • Detect typos in keyword argument names in format strings like '{name}'.format(nmae=value)
  • Validate docstrings and other string literals for consistent format parameter usage

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

A Flake8 plugin that validates string format calls, checking for mismatched parameters, missing arguments, and unindexed format strings incompatible with Python 2.6.

Yes, if you use Flake8 and want to catch format string errors statically. The plugin is lightweight, actively maintained, permissively licensed, and has no known vulnerabilities. Install it if format string correctness matters in your codebase; skip it only if you never use str.format() or already rely on type checking and runtime testing to catch these errors.

Install

flake8-string-format on PyPI

pip

pip install flake8-string-format

uv

uv add flake8-string-format

poetry

poetry add flake8-string-format

Installing flake8-string-format

Before you install

Low friction: pure Python wheel with a single runtime dependency on flake8. Actively maintained as of 2026-06-09 with recent Python 3.14 compatibility fixes.

License in practice

MIT license (permissive) — no restrictions on use, modification, or distribution in proprietary or open-source projects.

Quickstart

pip install flake8-string-format

Then run flake8 as usual; the plugin auto-registers:
  $ flake8 your_file.py
  your_file.py:1:1: FMT101 format string contains unindexed parameters

Requires flake8 to be installed; Python >= 3.8 required.

Verify before relying

  • Whether the plugin correctly handles all modern f-string edge cases beyond str.format()
  • Performance impact on large codebases with many format strings
  • Compatibility with recent Flake8 versions beyond 3.0

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.8)
Install friction low — pure-Python wheel
Runtime dependencies 1 — flake8
Maintenance actively maintained — 66 days since the last release
Last repo commit
First released
Downloads 170,838/month — #10,385 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: flake8_string_format-0.4.0-py3-none-any.whl

Keywords: flake8, format

Development Status :: 3 - AlphaEnvironment :: ConsoleFramework :: Flake8Intended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Topic :: Software Development :: Libraries :: Python ModulesTopic :: Software Development :: Quality Assurance

Tags

flake8 string format checkerformat string validationflake8 plugin format parametersdetect format string errorspython format call linter
lintingcode-quality

More Python Modules packages