Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

flake8 plugin which forbids printf-style string formatting

Project description

PyPI version Supported Python versions Build status Coverage

flake8-printf-formatting

flake8 plugin which forbids printf-style string formatting

Installation

pip install flake8-printf-formatting

Codes

Code Description
MOD001 do not use printf-style string formatting

Rationale

The official Python 3 documentation doesn't recommend printf-style string formatting:

The formatting operations described here exhibit a variety of quirks that lead to a number of common errors (such as failing to display tuples and dictionaries correctly). Using the newer formatted string literals, the str.format interface, or template strings may help avoid these errors. Each of these alternatives provides their own trade-offs and benefits of simplicity, flexibility, and/or extensibility.

As a pre-commit hook

See pre-commit for instructions

Sample .pre-commit-config.yaml:

-   repo: https://gitlab.com/pycqa/flake8
    rev: 3.7.8
    hooks:
    -   id: flake8
        additional_dependencies: [flake8-printf-formatting]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for flake8-printf-formatting, version 1.1.0
Filename, size File type Python version Upload date Hashes
Filename, size flake8_printf_formatting-1.1.0-py2.py3-none-any.whl (3.9 kB) File type Wheel Python version py2.py3 Upload date Hashes View hashes
Filename, size flake8-printf-formatting-1.1.0.tar.gz (3.4 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page