flake8-use-fstring
Flake8 plugin for string formatting style.
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-fstringuv
uv add flake8-use-fstringpoetry
poetry add flake8-use-fstringInstalling 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
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
flake8-pep3101A flake8 plugin that detects and flags…
copyleft · top 15,000 on PyPI
flyntFlynt is a command-line tool that automatically…
permissive · top 15,000 on PyPI
future-fstringsEnables f-string syntax in Python versions…
permissive · top 15,000 on PyPI
flake8-implicit-str-concatA Flake8 plugin that detects and reports…
permissive · top 15,000 on PyPI
flake8-string-formatA Flake8 plugin that validates string format…
permissive · top 15,000 on PyPI
flake8Flake8 is a command-line tool that combines…
permissive · top 1,000 on PyPI
flake8-annotationsA Flake8 plugin that enforces PEP 3107-style…
permissive · top 15,000 on PyPI
flake8-literalA flake8 plugin that enforces consistent…
copyleft · top 15,000 on PyPI
prefixedPrefixed provides a Float subclass that formats…
copyleft · top 5,000 on PyPI
flake8-no-implicit-concatA flake8 plugin that detects and forbids…
permissive · top 15,000 on PyPI