Upgrade pylint to 2.0.1 (#15683)

* Upgrade pylint to 2.0.1

* Pylint 2 bad-whitespace fix

* Pylint 2 possibly-unused-variable fixes

* Pylint 2 try-except-raise fixes

* Disable pylint fixme for todoist for now

https://github.com/PyCQA/pylint/pull/2320

* Disable pylint 2 useless-return for now

https://github.com/PyCQA/pylint/issues/2300

* Disable pylint 2 invalid-name for type variables for now

https://github.com/PyCQA/pylint/issues/1290

* Disable pylint 2 not-an-iterable for now

https://github.com/PyCQA/pylint/issues/2311

* Pylint 2 unsubscriptable-object workarounds

* Disable intentional pylint 2 assignment-from-nones

* Disable pylint 2 unsupported-membership-test apparent false positives

* Disable pylint 2 assignment-from-no-return apparent false positives

* Disable pylint 2 comparison-with-callable false positives

https://github.com/PyCQA/pylint/issues/2306
This commit is contained in:
Ville Skyttä authored and Paulus Schoutsen committed 2018-07-26 08:55:42 +02:00
1 parent 9fb8bc8991
commit eee9b50b70
20 files changed
+40 -37

No files matched your search

+5
View File
@@ -17,9 +17,11 @@ from typing import (Any, Optional, TypeVar, Callable, KeysView, Union, # noqa
from .dt import as_local, utcnow
# pylint: disable=invalid-name
T = TypeVar('T')
U = TypeVar('U')
ENUM_T = TypeVar('ENUM_T', bound=enum.Enum)
# pylint: enable=invalid-name
RE_SANITIZE_FILENAME = re.compile(r'(~|\.\.|/|\\)')
RE_SANITIZE_PATH = re.compile(r'(~|\.(\.)+)')
@@ -121,6 +123,9 @@ def get_random_string(length: int = 10) -> str:
class OrderedEnum(enum.Enum):
"""Taken from Python 3.4.0 docs."""
# https://github.com/PyCQA/pylint/issues/2306
# pylint: disable=comparison-with-callable
def __ge__(self: ENUM_T, other: ENUM_T) -> bool:
"""Return the greater than element."""
if self.__class__ is other.__class__:
+2 -1
View File
@@ -1,6 +1,7 @@
"""Decorator utility functions."""
from typing import Callable, TypeVar
CALLABLE_T = TypeVar('CALLABLE_T', bound=Callable)
CALLABLE_T = TypeVar('CALLABLE_T', bound=Callable) # noqa pylint: disable=invalid-name
class Registry(dict):
+1 -1
View File
@@ -98,7 +98,7 @@ def utc_from_timestamp(timestamp: float) -> dt.datetime:
def start_of_local_day(dt_or_d:
Union[dt.date, dt.datetime]=None) -> dt.datetime:
Union[dt.date, dt.datetime] = None) -> dt.datetime:
"""Return local datetime object of start of day from date or datetime."""
if dt_or_d is None:
date = now().date() # type: dt.date
+2 -2
View File
@@ -24,8 +24,8 @@ _SECRET_NAMESPACE = 'homeassistant'
SECRET_YAML = 'secrets.yaml'
__SECRET_CACHE = {} # type: Dict[str, JSON_TYPE]
JSON_TYPE = Union[List, Dict, str]
DICT_T = TypeVar('DICT_T', bound=Dict)
JSON_TYPE = Union[List, Dict, str] # pylint: disable=invalid-name
DICT_T = TypeVar('DICT_T', bound=Dict) # pylint: disable=invalid-name
class NodeListClass(list):