Skip to content

Commit

Permalink
handle explicit line joining
Browse files Browse the repository at this point in the history
  • Loading branch information
tanagumo committed Oct 8, 2023
1 parent 3e16145 commit 93e27f8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pycodestyle.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}'

Expand Down
14 changes: 14 additions & 0 deletions tests/test_E231.py
Original file line number Diff line number Diff line change
@@ -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, [])

0 comments on commit 93e27f8

Please sign in to comment.