Skip to content

Commit

Permalink
Merge pull request #752 from asottile/e204
Browse files Browse the repository at this point in the history
add handling for E204 whitespace after decorator
  • Loading branch information
hhatto authored Jun 16, 2024
2 parents a109296 + 13fe322 commit 6a73e27
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 6a73e27

Please sign in to comment.