From c1c9a4be729e63a2b72495f8b8d43f3a7580c4a9 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Mon, 30 May 2022 14:25:21 -0400 Subject: fix IndexError regression with E275 --- pycodestyle.py | 3 +-- testsuite/E27.py | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pycodestyle.py b/pycodestyle.py index e2e4b96..adf743c 100755 --- a/pycodestyle.py +++ b/pycodestyle.py @@ -497,8 +497,7 @@ def missing_whitespace_after_keyword(logical_line, tokens): tok0.string not in SINGLETONS and tok0.string not in ('async', 'await') and tok1.string not in ':\n'): - line, pos = tok0.end - yield pos, "E275 missing whitespace after keyword" + yield tok0.end, "E275 missing whitespace after keyword" @register_check diff --git a/testsuite/E27.py b/testsuite/E27.py index 91aa079..5b47657 100644 --- a/testsuite/E27.py +++ b/testsuite/E27.py @@ -49,3 +49,6 @@ else: pass #: Okay matched = {"true": True, "false": False} +#: E275:2:11 +if True: + assert(1) -- cgit v1.2.1