Skip to main content

Flake8 plugin that checks Python code against a set of opinionated style rules

Project description


.. image::
:alt: Build status

Flake8 plugin that checks Python code against a set of opinionated style rules.

Compatible with Python 2.7, 3.3+, PyPy 2.6+ and PyPy 2.4+.

PyPI page:

GitHub page:

To install using PyPI and pip::

pip install flake8-strict

Error codes

* ``S100``: First argument on the same line
* ``S101``: Multi-line construct missing trailing comma


* only source code without print statements is supported, this means:

* all valid Python 3 code
* Python 2 code with ``print_function`` enabled

* the existing checks are quite basic, they'll be improved and new
ones will added
* line/column numbers are off currently
* code like this will cause a parsing error (lib2to3.pgen2.parse.ParseError:
bad input)::

x for x in range(1),

It's ironic but the trailing comma is the issue here, without it parsing
works ok::

x for x in range(1)

This is a limitation of the underlying parser library and is unlikely to
be fixed in near future. Suggested workaround: wrap the generator in
parentheses, like this::

(x for x in range(1)),

If the function being called is dict or set the function calls can be
replaced with dict and set comprehensions therefore avoiding the issue

Versioning and backwards compatibility

Below 1.0.0: no guarantees.
Above 1.0.0, given a version number MAJOR.MINOR.PATCH:

* MAJOR is updated when backwards incompatible changes happen
* MINOR is updated when a new, backwards compatible, features are introduced
* PATCH is updated when a backwards compatible bug fixes are applied



* Fix blib2to3 import


* Use custom lib2to3 for better support for Python 3.6+
* Fix trailing comma after *args/**kwargs for Python 3.6+
* Allow usage of Python 3.6 features (e.g f-strings) without crashing


* Fixed elements inside class definition not being linted correctly (issue #36)


* Revert previous change (0.1.7) due to a lib2to3 issue.


* Fixed trailing comma after *args/**kwargs for Python 3.6+ (issue #25)


* Fixed decorator arguments not being linted.
* Fixed multiline imports not being linted.
* Fixed class definitions not being linted.


* Fixed UnicodeDecodeError if file contains non-ascii symbols (issue #22)
* Fixed error if newline is omitted from end of file (issue #18)
* Fixed erroneous comma suggested when unpacking function parameter (issue #21)


* Fixed handling of one-element lists (


* Fixed reading from stdin
* Fixed not being able to run when pycodestyle, not pep8, is installed (pep8
has been renamed to pycodestyle and flake8 2.6.0+ doesn't trigger pep8
installation anymore)
* Added support for set, list and dict literals and comprehensions
* Function calls with single, multi-line arguments are now treated more reasonably


* Fixed a "ValueError: need more than 2 values to unpack" error (GitHub issue #1).
* Fixed handling argument lists with keyword-only arguments
(compatibility with PEP 3102), this now doesn't raise S101 in this
case as it would be a syntax error.


* Fixed few ``AttributeError: 'Node' object has no attribute 'lineno'`` errors


First release


Copyright (C) 2015 Smarkets Limited <>

This module is released under the MIT License: (or see the LICENSE file)

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_strict, version 0.2.1
Filename, size File type Python version Upload date Hashes
Filename, size flake8_strict-0.2.1-py2.py3-none-any.whl (5.8 kB) File type Wheel Python version py2.py3 Upload date Hashes View hashes
Filename, size flake8_strict-0.2.1.tar.gz (6.0 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