Flake8 PEP 3101 plugin
December 22, 2023 ยท View on GitHub
.. -- coding: utf-8 --
.. image:: https://github.com/gforcada/flake8-pep3101/actions/workflows/testing.yml/badge.svg?branch=main :target: https://github.com/gforcada/flake8-pep3101/actions/workflows/testing.yml
.. image:: https://coveralls.io/repos/gforcada/flake8-pep3101/badge.svg?branch=main :target: https://coveralls.io/github/gforcada/flake8-pep3101?branch=main
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
.. _pyformat website: https://pyformat.info
.. _PEP 3101: https://www.python.org/dev/peps/pep-3101
.. _f-strings: https://peps.python.org/pep-0498/
.. _flake8-string-format: https://pypi.python.org/pypi/flake8-string-format
.. _plone.recipe.codeanalysis: https://pypi.python.org/pypi/plone.recipe.codeanalysis