diff --git a/pycodestyle.py b/pycodestyle.py index c492436b..0b398e1c 100755 --- a/pycodestyle.py +++ b/pycodestyle.py @@ -892,6 +892,9 @@ def missing_whitespace(logical_line, tokens): # tuple (and list for some reason?) elif text == ',' and next_char in ')]': pass + # explicit line joining + elif text == ',' and next_char in '\\': + pass else: yield start, f'E231 missing whitespace after {text!r}' diff --git a/tests/test_E231.py b/tests/test_E231.py new file mode 100644 index 00000000..7de09faf --- /dev/null +++ b/tests/test_E231.py @@ -0,0 +1,14 @@ +import unittest + +from testing.support import errors_from_src + + +class E231Test(unittest.TestCase): + def test_E231(self): + result = errors_from_src("""\ +with test(),\\ + test(), \\ + test(): + pass +""") + self.assertEqual(result, [])