From 99a57e5cbe472510d56207802a9957738d10f59d Mon Sep 17 00:00:00 2001 From: Lukasz Langa Date: Tue, 20 Dec 2016 01:54:34 -0800 Subject: [PATCH] Fixing flake8 E251 errors --- .flake8 | 1 - stdlib/2/codecs.pyi | 3 ++- stdlib/2/json.pyi | 2 +- stdlib/3/dis.pyi | 8 ++++---- stdlib/3/sqlite3/dbapi2.pyi | 4 ++-- third_party/2/selenium/webdriver/remote/webelement.pyi | 2 +- third_party/3.6/click/formatting.pyi | 2 +- third_party/3.6/click/types.pyi | 2 +- third_party/3/dateutil/parser.pyi | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.flake8 b/.flake8 index f6293b51e..2e1bbb9dc 100644 --- a/.flake8 +++ b/.flake8 @@ -19,6 +19,5 @@ ignore = F401, F811, E127, E128, E301, E302, E305, E501, E701, E704, B303 # Errors that we need to fix before enabling flake8 by default: # 921 F821 undefined name # 26 F403 from * import used -# 14 E251 unexpected spaces around keyword argument '=' # 7 E999 invalid syntax # 5 F405 name undefined or from * imports diff --git a/stdlib/2/codecs.pyi b/stdlib/2/codecs.pyi index 1dfbcbf31..0b2b49aca 100644 --- a/stdlib/2/codecs.pyi +++ b/stdlib/2/codecs.pyi @@ -6,6 +6,7 @@ from typing import ( Iterable, Iterator, List, + Optional, Tuple, Union, ) @@ -68,7 +69,7 @@ def register(search_function: Callable[[str], CodecInfo]) -> None: def open(filename: str, mode: str = ..., encoding: str = ..., errors: str = ..., buffering: int = ...) -> StreamReaderWriter: ... -def EncodedFile(file: BinaryIO, data_encoding: str, file_encoding: str = ..., errors = ...) -> 'StreamRecoder': +def EncodedFile(file: BinaryIO, data_encoding: str, file_encoding: str = ..., errors: Optional[str] = ...) -> 'StreamRecoder': ... def iterencode(iterator: Iterable[_decoded], encoding: str, errors: str = ...) -> Iterator[_encoded]: diff --git a/stdlib/2/json.pyi b/stdlib/2/json.pyi index c8db45f05..44a206782 100644 --- a/stdlib/2/json.pyi +++ b/stdlib/2/json.pyi @@ -63,7 +63,7 @@ class JSONDecoder(object): strict: bool = ..., object_pairs_hook: Callable[..., Any] = ...) -> None: ... - def decode(self, s: Union[Text, bytes], _w = ...) -> Any: ... + def decode(self, s: Union[Text, bytes], _w: Any = ...) -> Any: ... def raw_decode(self, s: Union[Text, bytes], diff --git a/stdlib/3/dis.pyi b/stdlib/3/dis.pyi index 7ce2e9f25..c26afc17b 100644 --- a/stdlib/3/dis.pyi +++ b/stdlib/3/dis.pyi @@ -55,9 +55,9 @@ def findlinestarts(code: _have_code) -> Iterator[Tuple[int, int]]: ... 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: ... -def disassemble(co: _have_code, lasti: int = ..., *, file = ...) -> None: ... -def show_code(co: _have_code, *, file: IO[str]=...) -> None: ... +def dis(x: _have_code_or_string = ..., *, file: IO[str] = None) -> None: ... +def distb(tb: types.TracebackType = ..., *, file: IO[str] = None) -> None: ... +def disassemble(co: _have_code, lasti: int = ..., *, file: IO[str] = None) -> None: ... +def show_code(co: _have_code, *, file: IO[str] = None) -> None: ... def get_instructions(x: _have_code, *, first_line: int = ...) -> Iterator[Instruction]: ... diff --git a/stdlib/3/sqlite3/dbapi2.pyi b/stdlib/3/sqlite3/dbapi2.pyi index a55a19cac..dcc202687 100644 --- a/stdlib/3/sqlite3/dbapi2.pyi +++ b/stdlib/3/sqlite3/dbapi2.pyi @@ -1,7 +1,7 @@ # Filip Hron # based heavily on Andrey Vlasovskikh's python-skeletons https://github.com/JetBrains/python-skeletons/blob/master/sqlite3.py -from typing import Any, Union, List, AnyStr, Iterator +from typing import Any, Union, List, AnyStr, Iterator, Optional from numbers import Integral from datetime import time, datetime from collections import Iterable @@ -106,7 +106,7 @@ class Connection: def create_aggregate(self, name: str, num_params: int, aggregate_class: type) -> None: ... def create_collation(self, name: str, callable: Any) -> None: ... def create_function(self, name: str, num_params: int, func: Any) -> None: ... - def cursor(self, cursorClass= Union[type, None]) -> Cursor: ... + def cursor(self, cursorClass: Optional[type] = ...) -> Cursor: ... def execute(self, sql: str, parameters: Iterable = ...) -> Cursor: ... # TODO: please check in executemany() if seq_of_parameters type is possible like this def executemany(self, sql: str, seq_of_parameters: Iterable[Iterable]) -> Cursor: ... diff --git a/third_party/2/selenium/webdriver/remote/webelement.pyi b/third_party/2/selenium/webdriver/remote/webelement.pyi index 05dfae05b..057703642 100644 --- a/third_party/2/selenium/webdriver/remote/webelement.pyi +++ b/third_party/2/selenium/webdriver/remote/webelement.pyi @@ -38,7 +38,7 @@ class WebElement: def find_element_by_css_selector(self, css_selector: basestring) -> WebElement: ... def find_elements_by_css_selector(self, css_selector: basestring) -> List[WebElement]: ... - def send_keys(self, *value: *basestring) -> None: ... + def send_keys(self, *value: basestring) -> None: ... def is_displayed(self) -> bool: ... @property def location_once_scrolled_into_view(self): ... diff --git a/third_party/3.6/click/formatting.pyi b/third_party/3.6/click/formatting.pyi index 57920abe5..84cc45f17 100644 --- a/third_party/3.6/click/formatting.pyi +++ b/third_party/3.6/click/formatting.pyi @@ -20,7 +20,7 @@ def wrap_text( width: int = 78, initial_indent: str = '', subsequent_indent: str = '', - preserve_paragraphs = False + preserve_paragraphs: bool = False ) -> str: ... diff --git a/third_party/3.6/click/types.pyi b/third_party/3.6/click/types.pyi index c56b4f0c2..73cabb659 100644 --- a/third_party/3.6/click/types.pyi +++ b/third_party/3.6/click/types.pyi @@ -34,7 +34,7 @@ class ParamType: def split_envvar_value(self, rv: str) -> List[str]: ... - def fail(self, message: str, param = None, ctx: Context = None) -> None: + def fail(self, message: str, param: Parameter = None, ctx: Context = None) -> None: ... diff --git a/third_party/3/dateutil/parser.pyi b/third_party/3/dateutil/parser.pyi index 96ead1887..32df99654 100644 --- a/third_party/3/dateutil/parser.pyi +++ b/third_party/3/dateutil/parser.pyi @@ -35,7 +35,7 @@ class parser(object): timestr: Union[str, bytes, IO[Any]], default: Optional[datetime], ignoretz: bool=..., - tzinfos =..., + tzinfos: Any =..., ) -> datetime: ... DEFAULTPARSER = ... # type: parser