Registry / testing / flake8-no-unnecessary-fstrings

flake8-no-unnecessary-fstrings

JSON →
library1.0.1pypypi✓ verified 30d ago

A flake8 plugin that flags unnecessary f-strings (e.g., f"{var}" where a simple string or format would do). Current version: 1.0.1. Release cadence is low; no recent updates.

testing
Install & Compatibility
Where this runs
tested against v1.0.1 · 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.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 19.4MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.9s · import 0.000s · 20MB
18MB installed
● package 18MB
Code
Verified usage

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

from flake8_no_unnecessary_fstrings import NoUnnecessaryFstringChecker

Install the plugin, configure flake8 to ignore rule F (if desired), then run flake8 on a file. The plugin adds rule code F.

echo -e '[flake8]\nextend-ignore = F' > .flake8 && flake8 your_file.py
Debug
Known footguns
gotchaThe plugin uses code 'F' for its rule, which conflicts with PyFlakes' F-coded rules. Ensure your flake8 configuration handles possible code collisions.
gotchaDetects f-strings with no expressions as unnecessary, but also flags f-strings with only simple variable references (e.g., f"{var}"). This may be overly aggressive if you prefer f-strings for consistency.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
16 hits · last 30 days
gptbot
4
amazonbot
4
ahrefsbot
3
claudebot
3
script
1
Resources