An extension for Flake8 that enforces best practices for `str.format` usage. It identifies various issues such as unindexed parameters, insufficient arguments in format calls, mixed implicit and explicit indexing, and unused arguments. The current version, 0.3.0, was released in February 2020, indicating a maintenance release cadence focusing on stability rather than frequent updates.
pip install flake8 flake8-string-formatVerified import paths — ran on the pinned version, not inferred.
After installation, `flake8-string-format` automatically integrates with Flake8. Simply run `flake8` on your project. The plugin will report errors using codes like P101 (unindexed parameters), P201 (missing arguments), and P301 (unused arguments). Errors can be ignored using the `--ignore` flag or by configuring your `.flake8` file.
Ensure `flake8` is installed and run the checks using the `flake8` command-line tool.
For full compatibility checks and consistent behavior, use Python 2.7+ or Python 3. For Python 2.6, be aware of the limitations regarding implicit parameter detection.
Consider ignoring P102 and P103 by default using `--ignore P102,P103` in your `flake8` configuration, unless your project specifically targets Python 2.6 with a strict no-unindexed-parameters policy for all strings.