Skip to main content

Obsolete - the modular Python source code checker

Project description

Flint is a thin wrapper around some Python checkers.


flint is now merged into Flake8 2.0. Please consider instead.


  • Based on the pep8 and the pyflakes checkers.
  • Easy to configure, with unified output.
  • Extendable through flint.extension entry points.
  • Plugin examples: flint-mccabe and pep8-naming


You can install, upgrade, uninstall flint with these commands:

$ pip install flint
$ pip install --upgrade flint
$ pip uninstall flint

Usage and output

Flint runs all the registered checkers with a single flint script. It accepts the same options as the pep8 tool and additional options for the plugins. The output merges the errors from all the tools.

Example (with McCabe plugin):

$ flint --version
0.1 (pep8: 1.4.2, pyflakes: 0.6.1, mccabe: 0.1)
$ flint --first --max-complexity 10 E401 multiple imports on one line E302 expected 2 blank lines, found 1 W602 deprecated form of raising exception E303 too many blank lines (2) E211 whitespace before '(' E201 whitespace after '{' E203 whitespace before ':' E202 whitespace before '}' E124 closing bracket does not match visual indentation W601 .has_key() is deprecated, use 'in' E721 do not compare types, use 'isinstance()' E501 line too long (81 > 79 characters) E125 continuation line does not distinguish itself from next logical line F841 local variable 'stop' is assigned to but never used C901 'OptionParser._process_short_opts' is too complex (10)


The behaviour may be configured at two levels.

The user settings are read from the ~/.config/flint file. Example:

ignore = E226,E302,E41
max-line-length = 160

At the project level, a tox.ini file or a setup.cfg file is read if present. Only the first file is considered. If this file does not have a [flint] section, no project specific configuration is loaded.

If the ignore option is not in the configuration and not in the arguments, only the error codes E226 and E241/E242 are ignored (see below).

Message codes

The convention of Flint is to assign a code to each error or warning, like the pep8 tool. These codes are used to configure the list of errors which are selected or ignored.

Each code consists of an upper case ASCII letter followed by three digits. The recommendation is to use a different prefix for each plugin.

A list of the known prefixes is published below:

The original PyFlakes does not provide error codes. Flint patches the PyFlakes messages to add the following codes:

code sample message
F401 module imported but unused
F402 import module from line N shadowed by loop variable
F403 ‘from module import *’ used; unable to detect undefined names
F404 future import(s) name after other statements
F811 redefinition of unused name from line N
F812 list comprehension redefines name from line N
F821 undefined name name
F822 undefined name name in __all__
F823 local variable name … referenced before assignment
F831 duplicate argument name in function definition
F841 local variable name is assigned to but never used

Original projects

Thank you to the authors of the various projects which are the building blocks of Flint:


0.2 (2013-02-23)

  • Rename extension flint-naming to pep8-naming
  • Read builtins from the configuration file (Issue #1)

0.1 (2013-02-11)

  • First release

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 flint, version 0.2
Filename, size File type Python version Upload date Hashes
Filename, size flint-0.2.tar.gz (6.4 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page