Fixing flake8 W errors

This commit is contained in:
Lukasz Langa
2016-12-19 21:52:56 -08:00
parent d2c0f83a72
commit b84f20a011
37 changed files with 35 additions and 72 deletions

View File

@@ -24,18 +24,14 @@ ignore = F401, F811, E301, E302, E305, E501, E701, E704
# 44 E127 continuation line over-indented for visual indent
# 37 E126 continuation line over-indented for hanging indent
# 30 E124 closing bracket does not match visual indentation
# 29 W391 blank line at end of file
# 28 E116 unexpected indentation (comment)
# 26 F403 from * import used
# 20 E101 mixed spaces and tabs
# 19 W191 tabs
# 14 E251 unexpected spaces around keyword argument '='
# 14 E203 whitespace before
# 10 W291 trailing whitespace
# 8 B006 mutable argument defaults
# 7 E999 invalid syntax
# 7 E111 indentation is not a multiple of four
# 5 W293 blank line with whitespace
# 5 F405 name undefined or from * imports
# 5 E123 closing bracket does not match indentation of opening bracket
# 4 E262 inline comment should start with #
@@ -43,7 +39,6 @@ ignore = F401, F811, E301, E302, E305, E501, E701, E704
# 4 E114 indentation is not a multiple of four
# 3 E303 too many blank lines
# 3 E125 continuation line with same indent as next logical line
# 2 W292 no newline at end of file
# 2 E241 multiple spaces after ,
# 2 E131 continuation line unaligned for hanging indent
# 2 B303 __metaclass__ use on Python 3

View File

@@ -28,4 +28,4 @@ class HTMLParser(ParserBase):
class HTMLParseError(Exception):
msg = ... # type: str
lineno = ... # type: int
offset = ... # type: int
offset = ... # type: int

View File

@@ -1,4 +1,4 @@
import collections
class UserString(collections.Sequence): ...
class MutableString(UserString, collections.MutableSequence): ...
class MutableString(UserString, collections.MutableSequence): ...

View File

@@ -29,8 +29,8 @@ class SRE_Scanner(object):
class SRE_Pattern(object):
pattern = ... # type: str
flags = ... # type: int
groups = ... # type: int
flags = ... # type: int
groups = ... # type: int
groupindex = ... # type: Mapping[int, int]
indexgroup = ... # type: Sequence[int]
def findall(self, source: str, pos:int = ..., endpos:int = ...) -> List[Union[tuple, str]]: ...

View File

@@ -37,5 +37,3 @@ class symtable(object):
varnames = ... # type: List[str]
def __init__(self, src: str, filename: str, startstr: str) -> None: ...

View File

@@ -38,6 +38,3 @@ class NodeVisitor():
class NodeTransformer(NodeVisitor):
def generic_visit(self, node: AST) -> None: ...

View File

@@ -14,9 +14,9 @@ DecimalTuple = NamedTuple('DecimalTuple',
('exponent', int)])
ROUND_DOWN = ... # type: str
ROUND_HALF_UP = ... # type: str
ROUND_HALF_UP = ... # type: str
ROUND_HALF_EVEN = ... # type: str
ROUND_CEILING = ... # type: str
ROUND_CEILING = ... # type: str
ROUND_FLOOR = ... # type: str
ROUND_UP = ... # type: str
ROUND_HALF_DOWN = ... # type: str
@@ -155,16 +155,16 @@ class Decimal(SupportsAbs[Decimal], SupportsFloat, SupportsInt):
def __format__(self, specifier, context=None, _localeconv=None) -> str: ...
class _ContextManager:
new_context = ... # type: Context
new_context = ... # type: Context
saved_context = ... # type: Context
def __init__(self, new_context: Context) -> None: ...
def __enter__(self): ...
def __exit__(self, t, v, tb): ...
class Context:
prec = ... # type: int
rounding = ... # type: str
Emin = ... # type: int
prec = ... # type: int
rounding = ... # type: str
Emin = ... # type: int
Emax = ... # type: int
capitals = ... # type: int
traps = ... # type: Dict[type, bool]

View File

@@ -247,4 +247,3 @@ class Values:
def ensure_value(self, attr, value) -> Any: ...
def read_file(self, filename, *args, **kwargs) -> None: ...
def read_module(self, modname, *args, **kwargs) -> None: ...

View File

@@ -203,4 +203,3 @@ def wait4(pid: int, options: int) -> Tuple[int, int, _r]: ...
def waitpid(pid: int, options: int) -> int:
raise OSError()
def write(fd: int, str: str) -> int: ...

View File

@@ -15,4 +15,3 @@ class struct_passwd(tuple):
def getpwall() -> List[struct_passwd]: ...
def getpwnam(name:str) -> struct_passwd: ...
def getpwuid(uid:int) -> struct_passwd: ...

View File

@@ -9,4 +9,3 @@ class sha(object):
def new(string: str = ...) -> sha: ...
blocksize = 0
digest_size = 0

View File

@@ -70,4 +70,3 @@ def translate(s: str, table: str, deletechars: str = ...) -> str:
def upper(s: str) -> str:
raise DeprecationWarning()

View File

@@ -358,4 +358,3 @@ def NamedTuple(typename: str, fields: Iterable[Tuple[str, Any]], *,
verbose: bool = ..., rename: bool = ...) -> Type[tuple]: ...
def NewType(name: str, tp: Type[_T]) -> Type[_T]: ...

View File

@@ -31,4 +31,3 @@ class Stats:
def print_call_line(self, name_size: int, source: str, call_dict: Dict[str, Any], arrow: str = ...) -> None: ...
def print_title(self) -> None: ...
def print_line(self, func: str) -> None: ...

View File

@@ -16,4 +16,3 @@ class zipimporter(object):
def get_source(self, fullname: str) -> Optional[str]: ...
def is_package(self, fullname: str) -> bool: ...
def load_module(self, fullname: str) -> ModuleType: ...

View File

@@ -54,4 +54,3 @@ class Task(Future[_T], Generic[_T]):
def cancel(self) -> bool: ...
def _step(self, value: Any = ..., exc: Exception = ...) -> None: ...
def _wakeup(self, future: Future[Any]) -> None: ...

View File

@@ -93,9 +93,9 @@ class Path(PurePath):
if sys.version_info >= (3, 5):
@classmethod
def home(cls: Type[_P]) -> _P: ...
def __new__(cls: Type[_P], *args: Union[str, PurePath],
def __new__(cls: Type[_P], *args: Union[str, PurePath],
**kwargs: Any) -> _P: ...
def absolute(self: _P) -> _P: ...
def expanduser(self: _P) -> _P: ...
def read_bytes(self) -> bytes: ...
@@ -105,7 +105,7 @@ class Path(PurePath):
def write_bytes(self, data: bytes) -> int: ...
def write_text(self, data: str, encoding: Optional[str] = ...,
errors: Optional[str] = ...) -> int: ...
class PosixPath(Path, PurePosixPath): ...
class WindowsPath(Path, PureWindowsPath): ...

View File

@@ -37,4 +37,3 @@ def literal_eval(node_or_string: Union[str, AST]) -> Any: ...
def walk(node: AST) -> Iterator[AST]: ...
PyCF_ONLY_AST = ... # type: int

View File

@@ -12,4 +12,3 @@ class ProcessPoolExecutor(Executor):
def submit(self, fn: Callable[..., _T], *args: Any, **kwargs: Any) -> Future[_T]: ...
def map(self, func: Callable[..., _T], *iterables: Any, timeout: Optional[float] = ..., chunksize: int = ...) -> Iterable[_T]: ...
def shutdown(self, wait: bool = ...) -> None: ...

View File

@@ -8,4 +8,3 @@ class ThreadPoolExecutor(Executor):
def submit(self, fn: Callable[..., _T], *args: Any, **kwargs: Any) -> Future[_T]: ...
def map(self, func: Callable[..., _T], *iterables: Any, timeout: Optional[float] = ..., chunksize: int = ...) -> Iterable[_T]: ...
def shutdown(self, wait: bool = ...) -> None: ...

View File

@@ -22,7 +22,7 @@ Instruction = NamedTuple("Instruction", [
])
# if sys.version_info >= (3, 4):
# if sys.version_info >= (3, 4):
class Bytecode:
codeobj = ... # type: types.CodeType
first_line = ... # type: int
@@ -36,7 +36,7 @@ class Bytecode:
@classmethod
def from_traceback(cls, tb: types.TracebackType) -> Bytecode: ...
COMPILER_FLAG_NAMES = ... # type: Dict[int, str]
@@ -50,7 +50,7 @@ def findlinestarts(code: _have_code) -> Iterator[Tuple[int, int]]: ...
# if sys.version_info >= (3, 2):
def code_info(x: _have_code_or_string) -> str: ...
# `file` parameter requires sys.version_info >= (3, 4):
def dis(x: _have_code_or_string = ..., *, file = ...) -> None: ...
def distb(tb: types.TracebackType = ..., *, file: IO[str] = ...) -> None: ...

View File

@@ -59,4 +59,3 @@ if sys.version_info >= (3, 2):
strict: Optional[bool]) -> None: ...
def parse(self, fp: BinaryIO, headersonly: bool = ...) -> Message: ...
def parsestr(self, text: str, headersonly: bool = ...) -> Message: ...

View File

@@ -4,4 +4,3 @@
import typing
from os import stat_result

View File

@@ -20,25 +20,25 @@ if sys.version_info >= (3, 5):
# Nearly same args as Popen.__init__ except for timeout, input, and check
def run(args: Union[str, Sequence[str]],
timeout: float = ...,
input: Union[str, bytes] = ...,
check: bool = ...,
bufsize: int = ...,
executable: str = ...,
stdin: Any = ...,
stdout: Any = ...,
stderr: Any = ...,
preexec_fn: Callable[[], Any] = ...,
close_fds: bool = ...,
shell: bool = ...,
cwd: str = ...,
env: Mapping[str, str] = ...,
universal_newlines: bool = ...,
startupinfo: Any = ...,
creationflags: int = ...,
restore_signals: bool = ...,
start_new_session: bool = ...,
pass_fds: Any = ...) -> CompletedProcess: ...
timeout: float = ...,
input: Union[str, bytes] = ...,
check: bool = ...,
bufsize: int = ...,
executable: str = ...,
stdin: Any = ...,
stdout: Any = ...,
stderr: Any = ...,
preexec_fn: Callable[[], Any] = ...,
close_fds: bool = ...,
shell: bool = ...,
cwd: str = ...,
env: Mapping[str, str] = ...,
universal_newlines: bool = ...,
startupinfo: Any = ...,
creationflags: int = ...,
restore_signals: bool = ...,
start_new_session: bool = ...,
pass_fds: Any = ...) -> CompletedProcess: ...
# Same args as Popen.__init__
if sys.version_info >= (3, 3):

View File

@@ -447,4 +447,3 @@ def NamedTuple(typename: str, fields: Iterable[Tuple[str, Any]], *,
verbose: bool = ..., rename: bool = ..., module: str = None) -> Type[tuple]: ...
def NewType(name: str, tp: Type[_T]) -> Type[_T]: ...

View File

@@ -1,4 +1,3 @@
# Stubs for kazoo (Python 2)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.

View File

@@ -1,4 +1,3 @@
# Stubs for kazoo.recipe (Python 2)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.

View File

@@ -1,4 +1,3 @@
# Stubs for requests.packages.urllib3.contrib (Python 3.4)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.

View File

@@ -1,4 +1,3 @@
# Stubs for requests.packages.urllib3.packages (Python 3.4)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.

View File

@@ -4,4 +4,3 @@
from . import connection
from . import request

View File

@@ -29,4 +29,3 @@ import six.moves.urllib_parse as urllib_parse
import six.moves.urllib_error as urllib_error
import six.moves.urllib as urllib
import six.moves.urllib_robotparser as urllib_robotparser

View File

@@ -47,4 +47,3 @@ class Lock:
__exit__ = ... # type: Any
def __aenter__(self): ...
def __aexit__(self, typ, value, tb): ...

View File

@@ -1,4 +1,3 @@
# Stubs for werkzeug.contrib (Python 2)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.

View File

@@ -1,4 +1,3 @@
# Stubs for Crypto.Random.Fortuna (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.

View File

@@ -1,4 +1,3 @@
# Stubs for requests.packages.urllib3.contrib (Python 3.4)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.

View File

@@ -1,4 +1,3 @@
# Stubs for requests.packages.urllib3.packages (Python 3.4)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.

View File

@@ -1,4 +1,3 @@
# Stubs for werkzeug.contrib (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.