From 53b5faf7a856ab95e92ea54684de40e211230d50 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Sun, 28 Feb 2016 15:24:48 -0800 Subject: [PATCH] Add __future__ import style checker This adds the [flake8-future-import][f] plugin for flake8, which enforces the standard set of `__future__` imports at the top of all Python files. This revealed a fair number of files that need to be fixed. To be revisited after #1887 is merged. [f]: https://github.com/xZise/flake8-future-import --- setup.cfg | 12 ++++++++---- tox.ini | 1 + 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/setup.cfg b/setup.cfg index 40eda74ec..16ab16367 100644 --- a/setup.cfg +++ b/setup.cfg @@ -4,7 +4,11 @@ logging-clear-handlers=1 eval-attr="!=slow" [flake8] -# E241 missing whitespace after ',' (used to align visually) -# E221 multiple spaces before operator (used to align visually) -# E731 do not assign a lambda expression, use a def -ignore=E241,E221,E731 +# Default pyflakes errors we ignore: +# - E241: missing whitespace after ',' (used to align visually) +# - E221: multiple spaces before operator (used to align visually) +# - E731: do not assign a lambda expression, use a def +# +# And for `flake8-future-import`, we define the set of imports we require: +# division, absolute_import, and print_function. +ignore=E241,E221,E731,FI50,FI51,FI12,FI53,FI14,FI15 diff --git a/tox.ini b/tox.ini index d220f1895..cd29693a1 100644 --- a/tox.ini +++ b/tox.ini @@ -47,4 +47,5 @@ commands = [testenv:flake8] deps = flake8 + flake8-future-import commands = flake8 beets beetsplug beet test setup.py docs