Skip to content

Commit d33af41

Browse files
committed
Lint
1 parent 0c22f7c commit d33af41

File tree

4 files changed

+15
-13
lines changed

4 files changed

+15
-13
lines changed

flake8_dunder_all/__init__.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,23 @@
3333
import ast
3434
import sys
3535
from enum import Enum
36-
from typing import Any, Generator, Iterator, List, Optional, Sequence, Set, Tuple, Type, Union, cast
36+
from typing import TYPE_CHECKING, Any, Generator, Iterator, List, Optional, Sequence, Set, Tuple, Type, Union, cast
3737

3838
# 3rd party
3939
import natsort
4040
from consolekit.terminal_colours import Fore
4141
from domdf_python_tools.paths import PathPlus
4242
from domdf_python_tools.typing import PathLike
4343
from domdf_python_tools.utils import stderr_writer
44-
from flake8.options.manager import OptionManager # type: ignore
44+
from flake8.options.manager import OptionManager # type: ignore[import]
4545

4646
# this package
4747
from flake8_dunder_all.utils import find_noqa, get_docstring_lineno, mark_text_ranges
4848

49+
if TYPE_CHECKING:
50+
# stdlib
51+
from argparse import Namespace
52+
4953
__author__: str = "Dominic Davis-Foster"
5054
__copyright__: str = "2020 Dominic Davis-Foster"
5155
__license__: str = "MIT"
@@ -365,7 +369,7 @@ def add_options(cls, option_manager: OptionManager) -> None: # noqa: D102 # pr
365369
)
366370

367371
@classmethod
368-
def parse_options(cls, options): # noqa: D102 # pragma: no cover
372+
def parse_options(cls, options: "Namespace") -> None: # noqa: D102 # pragma: no cover
369373
# note: this sets the option on the class and not the instance
370374
cls.dunder_all_alphabetical = AlphabeticalOptions(options.dunder_all_alphabetical)
371375

tests/__init__.py

Whitespace-only changes.

tests/test_flake8_dunder_all.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,17 @@
77
# 3rd party
88
import pytest
99
from coincidence.regressions import AdvancedFileRegressionFixture
10-
from common import (
11-
if_type_checking_else_source,
12-
if_type_checking_source,
13-
if_type_checking_try_finally_source,
14-
if_type_checking_try_source
15-
)
1610
from consolekit.terminal_colours import Fore
1711
from domdf_python_tools.paths import PathPlus
1812

1913
# this package
2014
from flake8_dunder_all import AlphabeticalOptions, Plugin, Visitor, check_and_add_all
2115
from flake8_dunder_all.utils import mark_text_ranges
2216
from tests.common import (
17+
if_type_checking_else_source,
18+
if_type_checking_source,
19+
if_type_checking_try_finally_source,
20+
if_type_checking_try_source,
2321
mangled_source,
2422
not_type_checking_if_source,
2523
results,

tests/test_main.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
from consolekit.terminal_colours import Fore
99
from consolekit.testing import CliRunner, Result
1010
from domdf_python_tools.paths import PathPlus
11-
from test_flake8_dunder_all import (
11+
12+
# this package
13+
from flake8_dunder_all.__main__ import main
14+
from tests.test_flake8_dunder_all import (
1215
mangled_source,
1316
testing_source_a,
1417
testing_source_b,
@@ -25,9 +28,6 @@
2528
testing_source_l
2629
)
2730

28-
# this package
29-
from flake8_dunder_all.__main__ import main
30-
3131

3232
@pytest.mark.parametrize(
3333
"source, members, ret",

0 commit comments

Comments
 (0)