Skip to content

Commit

Permalink
add handling for future E204 whitespace after decorator
Browse files Browse the repository at this point in the history
  • Loading branch information
asottile committed Jun 15, 2024
1 parent a109296 commit 13fe322
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions autopep8.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,7 @@ def __init__(self, filename,
self.fix_e133 = self.fix_e131
self.fix_e202 = self.fix_e201
self.fix_e203 = self.fix_e201
self.fix_e204 = self.fix_e201
self.fix_e211 = self.fix_e201
self.fix_e221 = self.fix_e271
self.fix_e222 = self.fix_e271
Expand Down
6 changes: 6 additions & 0 deletions test/test_autopep8.py
Original file line number Diff line number Diff line change
Expand Up @@ -1859,6 +1859,12 @@ def test_e203_with_newline(self):
with autopep8_context(line, options=['--select=E203']) as result:
self.assertEqual(fixed, result)

def test_e204(self):
line = '@ decorator\n'
fixed = '@decorator\n'
with autopep8_context(line, options=['--select=E204']) as result:
self.assertEqual(fixed, result)

def test_e211(self):
line = 'd = [1, 2, 3]\nprint(d [0])\n'
fixed = 'd = [1, 2, 3]\nprint(d[0])\n'
Expand Down

0 comments on commit 13fe322

Please sign in to comment.