Skip to content

Commit b58371d

Browse files
committed
Handle edge cases.
1 parent 9a7c58d commit b58371d

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

flake8_dunder_all/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,11 +249,12 @@ def check_and_add_all(filename: PathLike, quote_type: str = '"') -> int:
249249
source = filename.read_text()
250250
for line in source.splitlines():
251251
noqas = find_noqa(line)
252-
if noqas is not None and "DALL000" in noqas.group(1).upper().split(','):
253-
return 0
252+
if noqas is not None:
253+
if "DALL000" in noqas.group(1).rstrip().upper().split(','):
254+
return 0
254255

255256
tree = ast.parse(source)
256-
if sys.version_info < (3, 8): # pragma: no cover (<py38)
257+
if sys.version_info < (3, 8): # pragma: no cover (py38+)
257258
mark_text_ranges(tree, source)
258259

259260
except SyntaxError:

0 commit comments

Comments
 (0)