Skip to main content

Checks for old string formatting

Project description

https://github.com/gforcada/flake8-pep3101/actions/workflows/testing.yml/badge.svg?branch=master https://coveralls.io/repos/gforcada/flake8-pep3101/badge.svg?branch=master

Flake8 PEP 3101 plugin

Python has three string formatting options:

  • the old percent operator

  • the .format() string method

  • f-strings (only since python 3.6+)

Although f-strings are more ergonomic, there a certain scenarios where the .format() method is still the only viable option.

See pyformat website for examples of the percent operator vs the format() method.

For a more format definition see the PEP 3101.

This plugin is based on a python checker that was in plone.recipe.codeanalysis.

Install

Install with pip:

$ pip install flake8-pep3101

Requirements

  • Python 3.8, 3.9, 3.10, 3.11 and pypy3

  • flake8

Extras

If you want to check whether your new style formatting are correctly defined, check flake8-string-format plugin.

License

GPL 2.0

Project details


Download files

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

Source Distribution

flake8_pep3101-2.1.0.tar.gz (14.5 kB view hashes)

Uploaded Source

Built Distribution

flake8_pep3101-2.1.0-py3-none-any.whl (16.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page