skillfed

flake8-use-fstring

Flake8 plugin for string formatting style.

flake8-use-fstring v1.4 425.3K downloads/30d#6,759 on PyPI50
Permissive license DORMANT released

What it is and what it does

flake8-use-fstring is a flake8 linter plugin that flags instances of % formatting and .format() method calls in Python code, pushing developers toward f-strings. It reports three error codes: FS001 for % formatting, FS002 for .format usage, and FS003 (disabled by default) for strings that look like they should be f-strings but lack the f prefix. The plugin works by scanning logical lines and checking whether the value before % or .format is a string literal, with configurable greedy levels (0–2) to control sensitivity and reduce false positives.

The plugin integrates directly into flake8's workflow and requires no runtime dependencies. It supports Python 3.6 and later, matching the version f-strings were introduced. Configuration is done via command-line flags or a .flake8 config file. The main trade-off is that without type information, the plugin cannot always determine whether a value is truly a string, so higher greedy levels may report false positives on non-string values.

Use it for:

  • Enforce f-string adoption across a codebase during a Python modernization effort.
  • Catch legacy string formatting in code reviews as part of a flake8 linting pipeline.
  • Configure FS003 to flag strings with {} that are missing the f prefix, catching incomplete f-string migrations.
  • Use greedy level 0 (default) in strict projects where only obvious string literals should trigger warnings.

Worth the install?

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

A flake8 plugin that detects and flags old-style string formatting (% and .format) to encourage migration to f-strings in Python code.

Yes, if you are actively modernizing a codebase to f-strings and already use flake8. The plugin is lightweight, has no dependencies, and integrates seamlessly. However, maintenance is dormant (last release 1479 days ago), so compatibility with very recent flake8 versions is uncertain—verify it works with your flake8 version before relying on it in CI/CD. For new projects, consider whether a more actively maintained linter rule might be preferable.

Install

flake8-use-fstring on PyPI

pip

pip install flake8-use-fstring

uv

uv add flake8-use-fstring

poetry

poetry add flake8-use-fstring

Installing flake8-use-fstring

Before you install

High install friction due to being a flake8 plugin with no runtime dependencies but requiring integration into an existing flake8 setup. Last release was 1479 days ago; repository is dormant but not archived, so maintenance is stalled.

License in practice

Licensed under MIT (permissive), so no restrictions on use or modification in commercial or private projects.

Quickstart

pip install flake8-use-fstring

# Then run flake8 as normal; the plugin auto-registers
flake8 myfile.py

# Configure in .flake8:
# [flake8]
# percent-greedy = 0
# format-greedy = 0

Requires Python >= 3.6 and an existing flake8 installation; the plugin only works as a flake8 extension, not standalone.

Verify before relying

  • Whether the plugin remains compatible with recent flake8 versions given the dormant maintenance status.
  • Real-world false-positive rate at greedy levels 1 and 2 beyond the documented examples.

Package facts

License not declared (permissive)
Python support supports the current Python release (>=3.6)
Install friction high — source build required
Runtime dependencies none
Maintenance dormant — 1,479 days since the last release
Last repo commit
First released
Downloads 425,296/month — #6,759 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: flake8-use-fstring-1.4.tar.gz

Development Status :: 3 - AlphaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries :: Python ModulesTopic :: Software Development :: Quality Assurance

Tags

flake8 f-string enforcementdetect percent formattingenforce modern string formattingflake8 format method checkerpython f-string linter
linter-plugincode-stylemodernization

More Python Modules packages