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

+1 -1
View File
@@ -45,7 +45,7 @@ NOTIFICATION_AUTH_TITLE = 'Apple TV Authentication'
NOTIFICATION_SCAN_ID = 'apple_tv_scan_notification'
NOTIFICATION_SCAN_TITLE = 'Apple TV Scan'
T = TypeVar('T')
T = TypeVar('T') # pylint: disable=invalid-name
# This version of ensure_list interprets an empty dict as no value
@@ -26,6 +26,9 @@ CONF_PROJECT_DUE_DATE = 'due_date_days'
CONF_PROJECT_LABEL_WHITELIST = 'labels'
CONF_PROJECT_WHITELIST = 'include_projects'
# https://github.com/PyCQA/pylint/pull/2320
# pylint: disable=fixme
# Calendar Platform: Does this calendar event last all day?
ALL_DAY = 'all_day'
# Attribute: All tasks in this project
@@ -439,6 +439,7 @@ class Profiles:
@classmethod
def get_default(cls, entity_id):
"""Return the default turn-on profile for the given light."""
# pylint: disable=unsupported-membership-test
name = entity_id + ".default"
if name in cls._all:
return name
@@ -216,12 +216,8 @@ class BluesoundPlayer(MediaPlayerDevice):
async def force_update_sync_status(
self, on_updated_cb=None, raise_timeout=False):
"""Update the internal status."""
resp = None
try:
resp = await self.send_bluesound_command(
'SyncStatus', raise_timeout, raise_timeout)
except Exception:
raise
resp = await self.send_bluesound_command(
'SyncStatus', raise_timeout, raise_timeout)
if not resp:
return None
@@ -253,9 +253,11 @@ class PandoraMediaPlayer(MediaPlayerDevice):
_LOGGER.warning("On unexpected station list page")
self._pianobar.sendcontrol('m') # press enter
self._pianobar.sendcontrol('m') # do it again b/c an 'i' got in
# pylint: disable=assignment-from-none
response = self.update_playing_status()
elif match_idx == 3:
_LOGGER.debug("Received new playlist list")
# pylint: disable=assignment-from-none
response = self.update_playing_status()
else:
response = self._pianobar.before.decode('utf-8')
+4 -9
View File
@@ -186,19 +186,14 @@ class CityBikesNetwork:
networks = yield from async_citybikes_request(
hass, NETWORKS_URI, NETWORKS_RESPONSE_SCHEMA)
cls.NETWORKS_LIST = networks[ATTR_NETWORKS_LIST]
networks_list = cls.NETWORKS_LIST
network = networks_list[0]
result = network[ATTR_ID]
minimum_dist = location.distance(
latitude, longitude,
network[ATTR_LOCATION][ATTR_LATITUDE],
network[ATTR_LOCATION][ATTR_LONGITUDE])
for network in networks_list[1:]:
result = None
minimum_dist = None
for network in cls.NETWORKS_LIST:
network_latitude = network[ATTR_LOCATION][ATTR_LATITUDE]
network_longitude = network[ATTR_LOCATION][ATTR_LONGITUDE]
dist = location.distance(
latitude, longitude, network_latitude, network_longitude)
if dist < minimum_dist:
if minimum_dist is None or dist < minimum_dist:
minimum_dist = dist
result = network[ATTR_ID]
+1 -5
View File
@@ -173,8 +173,4 @@ class NZBGetAPI:
@Throttle(MIN_TIME_BETWEEN_UPDATES)
def update(self):
"""Update cached response."""
try:
self.status = self.post('status')['result']
except requests.exceptions.ConnectionError:
# failed to update status - exception already logged in self.post
raise
self.status = self.post('status')['result']
+1 -5
View File
@@ -162,8 +162,4 @@ class PyLoadAPI:
@Throttle(MIN_TIME_BETWEEN_UPDATES)
def update(self):
"""Update cached response."""
try:
self.status = self.post('speed')
except requests.exceptions.ConnectionError:
# Failed to update status - exception already logged in self.post
raise
self.status = self.post('speed')