From 13fe3228162c8b97f5f67da90ddb17d3379cf5aa Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sat, 15 Jun 2024 14:46:44 -0400 Subject: [PATCH] add handling for future E204 whitespace after decorator --- autopep8.py | 1 + test/test_autopep8.py | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/autopep8.py b/autopep8.py index fd59890c..a6661c7f 100755 --- a/autopep8.py +++ b/autopep8.py @@ -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 diff --git a/test/test_autopep8.py b/test/test_autopep8.py index bf73fa08..05c396df 100755 --- a/test/test_autopep8.py +++ b/test/test_autopep8.py @@ -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'