diff options
| author | Ian Stapleton Cordasco <graffatcolmingov@gmail.com> | 2019-02-17 15:23:30 +0000 |
|---|---|---|
| committer | Ian Stapleton Cordasco <graffatcolmingov@gmail.com> | 2019-02-17 15:23:30 +0000 |
| commit | 59c2f093de827167386c63d6a60c04012a8a2768 (patch) | |
| tree | 2bc14f7fecc80eabb7655a43764fabdedec7f8ce /src/flake8 | |
| parent | a21d74152bff0e24dc27f32c5a6b019cb0b9a0e3 (diff) | |
| parent | c71fadb18ca9f23d8a6474c0155404b49e21c30e (diff) | |
| download | flake8-59c2f093de827167386c63d6a60c04012a8a2768.tar.gz | |
Merge branch 'mypy_improvements' into 'master'
Improve a few mypy type annotations
See merge request pycqa/flake8!307
Diffstat (limited to 'src/flake8')
| -rw-r--r-- | src/flake8/checker.py | 4 | ||||
| -rw-r--r-- | src/flake8/main/application.py | 5 | ||||
| -rw-r--r-- | src/flake8/utils.py | 6 |
3 files changed, 8 insertions, 7 deletions
diff --git a/src/flake8/checker.py b/src/flake8/checker.py index 34db7db..d3ce35e 100644 --- a/src/flake8/checker.py +++ b/src/flake8/checker.py @@ -5,7 +5,7 @@ import logging import signal import sys import tokenize -from typing import List, Optional +from typing import List, Optional, Tuple try: import multiprocessing @@ -246,7 +246,7 @@ class Manager(object): LOG.info("Checking %d files", len(self.checkers)) def report(self): - # type: () -> (int, int) + # type: () -> Tuple[int, int] """Report all of the errors found in the managed file checkers. This iterates over each of the checkers and reports the errors sorted diff --git a/src/flake8/main/application.py b/src/flake8/main/application.py index 4515d13..6e8ddaf 100644 --- a/src/flake8/main/application.py +++ b/src/flake8/main/application.py @@ -4,7 +4,7 @@ from __future__ import print_function import logging import sys import time -from typing import List, Optional, Sequence +from typing import List, Optional import flake8 from flake8 import checker @@ -99,6 +99,7 @@ class Application(object): self.parsed_diff = {} def parse_preliminary_options_and_args(self, argv=None): + # type: (Optional[List[str]]) -> None """Get preliminary options and args from CLI, pre-plugin-loading. We need to know the values of a few standard options and args now, so @@ -347,7 +348,7 @@ class Application(object): self.formatter.show_statistics(self.guide.stats) def initialize(self, argv): - # type: (Sequence[str]) -> None + # type: (Optional[List[str]]) -> None """Initialize the application to be run. This finds the plugins, registers their options, and parses the diff --git a/src/flake8/utils.py b/src/flake8/utils.py index 6048132..b95d4db 100644 --- a/src/flake8/utils.py +++ b/src/flake8/utils.py @@ -8,8 +8,8 @@ import platform import re import sys import tokenize -from typing import Callable, Dict, Generator, List, Pattern, Sequence, Tuple -from typing import Union +from typing import Callable, Dict, Generator, List, Pattern, Sequence, Set +from typing import Tuple, Union from flake8 import exceptions @@ -217,7 +217,7 @@ def stdin_get_value(): def parse_unified_diff(diff=None): - # type: (str) -> List[str] + # type: (str) -> Dict[str, Set[int]] """Parse the unified diff passed on stdin. :returns: |
