Registry / testing / flake8-no-unnecessary-fstrings

flake8-no-unnecessary-fstrings

JSON →
library1.0.1pypypi✓ verified 82d 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.

pip install flake8-no-unnecessary-fstrings
INSTALL
IMPORT
SIG · FLAKE8-NO-UNNECESS
F
flake8-no-unnecessary-fstrings
testingpythonv1.0.1
Install
1.9s avg
Import
Disk
18MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
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.

NoUnnecessaryFstringChecker
from flake8_no_unnecessary_fstrings import NoUnnecessaryFstringChecker
from flake8_no_unnecessary_fstrings import F

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 issues
gotchaThe plugin uses code 'F' for its rule, which conflicts with PyFlakes' F-coded rules. Ensure your flake8 configuration handles possible code collisions.
fix
Use flake8's --select or --ignore with full code e.g., '--ignore=F' vs '--ignore=F401'.
affects: all
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.
fix
Understand the rule's intent: ban f-strings that don't use f-string features (like formatting or multiple expressions). Consider disabling with --no-necessary-fstrings or adding noqa.
affects: all
Upgrade
Version history
1.0.1latest on PyPI · released Sep 13, 2020
Audit
Dependencies
flake8requiredRequired as the hosting linter framework.
Agent activity
6 hits · last 30 days
node
6
Resources
flake8-no-unnecessary-fstrings — pip install flake8-no-unnecessary-fstrings · libregistry