Skip to content

Commit

Permalink
Merge branch 'master' into alphabetical
Browse files Browse the repository at this point in the history
  • Loading branch information
domdfcoding committed Jan 31, 2022
2 parents 5e5285f + 1d660a0 commit d0baed7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions flake8_dunder_all/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import ast
import sys
from enum import Enum
from typing import Any, Generator, Optional, Sequence, Set, Tuple, Type, Union, cast
from typing import Any, Generator, List, Optional, Sequence, Set, Tuple, Type, Union, cast

# 3rd party
import natsort
Expand Down Expand Up @@ -327,7 +327,7 @@ def check_and_add_all(filename: PathLike, quote_type: str = '"') -> int:
.. versionchanged:: 0.2.0
Now returns ``0`` and doesn't add ``__all__`` if the file contains a ``# noqa: DALL000`` comment.
Now returns ``0`` and doesn't add ``__all__`` if the file contains a ``noqa: DALL000`` comment.
"""

quotes = {"'", '"'}
Expand All @@ -341,7 +341,8 @@ def check_and_add_all(filename: PathLike, quote_type: str = '"') -> int:
for line in source.splitlines():
noqas = find_noqa(line)
if noqas is not None:
if "DALL000" in noqas.group(1).rstrip().upper().split(','):
noqa_list: List[str] = noqas.group(1).rstrip().upper().split(',')
if "DALL000" in noqa_list:
return 0

tree = ast.parse(source)
Expand Down

0 comments on commit d0baed7

Please sign in to comment.