Skip to content

Commit

Permalink
Add more files to flake8 run.
Browse files Browse the repository at this point in the history
  • Loading branch information
bwendling committed Nov 4, 2021
1 parent 82ebfca commit 9d6808a
Show file tree
Hide file tree
Showing 13 changed files with 253 additions and 254 deletions.
6 changes: 2 additions & 4 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[flake8]
ignore =
# 'toml' imported but unused
F401,
# closing bracket does not match visual indentation
E124,
# continuation line over-indented for hanging indent
Expand All @@ -11,10 +13,6 @@ ignore =
# line break after binary operator
W504

exclude =
yapf/yapflib/py3compat.py
yapftests/*

disable-noqa
indent-size = 2
max-line-length = 80
8 changes: 4 additions & 4 deletions yapf/yapflib/py3compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
StringIO = io.StringIO
BytesIO = io.BytesIO

import codecs
import codecs # noqa: F811

def open_with_encoding(filename, mode, encoding, newline=''): # pylint: disable=unused-argument
def open_with_encoding(filename, mode, encoding, newline=''): # pylint: disable=unused-argument # noqa
return codecs.open(filename, mode=mode, encoding=encoding)

import functools
Expand Down Expand Up @@ -62,13 +62,13 @@ def fake_wrapper(user_function):

return fake_wrapper

range = xrange
range = xrange # noqa: F821

from itertools import ifilter
raw_input = raw_input

import ConfigParser as configparser
CONFIGPARSER_BOOLEAN_STATES = configparser.ConfigParser._boolean_states # pylint: disable=protected-access
CONFIGPARSER_BOOLEAN_STATES = configparser.ConfigParser._boolean_states # pylint: disable=protected-access # noqa


def EncodeAndWriteToStdout(s, encoding='utf-8'):
Expand Down
2 changes: 1 addition & 1 deletion yapftests/blank_line_calculator_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ def _():
# reason="https://github.com/pypa/setuptools/issues/706")
def test_unicode_filename_in_sdist(self, sdist_unicode, tmpdir, monkeypatch):
pass
""")
""") # noqa
uwlines = yapf_test_helper.ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))

Expand Down
2 changes: 1 addition & 1 deletion yapftests/file_resources_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ def test_write_to_stdout(self):
self.assertEqual(stream.getvalue(), s)

def test_write_encoded_to_stdout(self):
s = '\ufeff# -*- coding: utf-8 -*-\nresult = "passed"\n' # pylint: disable=anomalous-unicode-escape-in-string
s = '\ufeff# -*- coding: utf-8 -*-\nresult = "passed"\n' # pylint: disable=anomalous-unicode-escape-in-string # noqa
stream = BufferedByteStream() if py3compat.PY3 else py3compat.StringIO()
with utils.stdout_redirector(stream):
file_resources.WriteReformattedCode(
Expand Down
2 changes: 1 addition & 1 deletion yapftests/line_joiner_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def testSimpleMultipleLineStatementWithLargeIndent(self):
def testOverColumnLimit(self):
code = textwrap.dedent(u"""\
if instance(bbbbbbbbbbbbbbbbbbbbbbbbb, int): cccccccccccccccccccccccccc = ddddddddddddddddddddd
""")
""") # noqa
self._CheckLineJoining(code, join_lines=False)


Expand Down
Loading

0 comments on commit 9d6808a

Please sign in to comment.