summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnthony Sottile <asottile@umich.edu>2019-02-16 18:36:14 -0800
committerAnthony Sottile <asottile@umich.edu>2019-02-17 00:16:19 -0800
commitc71fadb18ca9f23d8a6474c0155404b49e21c30e (patch)
tree4a052c378f25b46b5ea7b2335c2c0d54146f10bd /src
parent684ffb3306af89e4092c4598aa9ae4294eb52eb8 (diff)
downloadflake8-c71fadb18ca9f23d8a6474c0155404b49e21c30e.tar.gz
Improve a few mypy type annotations
Diffstat (limited to 'src')
-rw-r--r--src/flake8/checker.py4
-rw-r--r--src/flake8/main/application.py5
-rw-r--r--src/flake8/utils.py6
3 files changed, 8 insertions, 7 deletions
diff --git a/src/flake8/checker.py b/src/flake8/checker.py
index 138bb4f..2680ed3 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
@@ -247,7 +247,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: