Switch to new noqa syntax for flake8 3.0

Apparently, `# noqa ignore=X` worked before, but now the syntax is more terse,
like this: `# noqa: X`.

See the changelog here:
http://flake8.pycqa.org/en/latest/release-notes/3.0.0.html
This commit is contained in:
Adrian Sampson 2016-07-25 15:02:10 -04:00
parent 6a71e4bad4
commit 58afaf07a5
4 changed files with 8 additions and 7 deletions

View file

@ -40,7 +40,7 @@ import beets
# `memoryview`, depending on the Python version, tells it that we
# actually mean non-text data.
if six.PY2:
BLOB_TYPE = buffer # noqa ignore=F821
BLOB_TYPE = buffer # noqa: F821
else:
BLOB_TYPE = memoryview

View file

@ -658,9 +658,10 @@ def as_string(value):
"""Convert a value to a Unicode object for matching with a query.
None becomes the empty string. Bytestrings are silently decoded.
"""
buffer_types = memoryview
if six.PY2:
buffer_types = (buffer, memoryview) # noqa ignore=F821
buffer_types = buffer, memoryview # noqa: F821
else:
buffer_types = memoryview
if value is None:
return u''

View file

@ -44,9 +44,9 @@ REDACTED_TOMBSTONE = 'REDACTED'
# Utilities.
PY3 = sys.version_info[0] == 3
STRING = str if PY3 else unicode # noqa ignore=F821
BASESTRING = str if PY3 else basestring # noqa ignore=F821
NUMERIC_TYPES = (int, float) if PY3 else (int, float, long) # noqa ignore=F821
STRING = str if PY3 else unicode # noqa: F821
BASESTRING = str if PY3 else basestring # noqa: F821
NUMERIC_TYPES = (int, float) if PY3 else (int, float, long) # noqa: F821
def iter_first(sequence):

View file

@ -30,7 +30,7 @@ from beets import ui
import gi
gi.require_version('Gst', '1.0')
from gi.repository import GLib, Gst # noqa ignore=E402
from gi.repository import GLib, Gst # noqa: E402
Gst.init(None)