From 3246b49a4529ea90c9d984623fc0f8db30a04dcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 4 Aug 2018 16:22:22 +0300 Subject: [PATCH] Upgrade pylint to 2.1.0 (#15811) * Upgrade pylint to 2.1.0 * Remove no longer needed pylint disables --- homeassistant/components/binary_sensor/bayesian.py | 1 - homeassistant/components/binary_sensor/threshold.py | 1 - homeassistant/components/calendar/todoist.py | 3 --- homeassistant/components/light/group.py | 2 -- homeassistant/components/sensor/min_max.py | 1 - homeassistant/components/sensor/statistics.py | 1 - homeassistant/helpers/template.py | 1 - homeassistant/scripts/benchmark/__init__.py | 2 -- pylintrc | 4 +--- requirements_test.txt | 2 +- requirements_test_all.txt | 2 +- 11 files changed, 3 insertions(+), 17 deletions(-) diff --git a/homeassistant/components/binary_sensor/bayesian.py b/homeassistant/components/binary_sensor/bayesian.py index 72110eb50c9..75906e8ac5d 100644 --- a/homeassistant/components/binary_sensor/bayesian.py +++ b/homeassistant/components/binary_sensor/bayesian.py @@ -122,7 +122,6 @@ class BayesianBinarySensor(BinarySensorDevice): def async_added_to_hass(self): """Call when entity about to be added.""" @callback - # pylint: disable=invalid-name def async_threshold_sensor_state_listener(entity, old_state, new_state): """Handle sensor state changes.""" diff --git a/homeassistant/components/binary_sensor/threshold.py b/homeassistant/components/binary_sensor/threshold.py index 360671d1cea..39681c894b3 100644 --- a/homeassistant/components/binary_sensor/threshold.py +++ b/homeassistant/components/binary_sensor/threshold.py @@ -86,7 +86,6 @@ class ThresholdSensor(BinarySensorDevice): self._state = False self.sensor_value = None - # pylint: disable=invalid-name @callback def async_threshold_sensor_state_listener( entity, old_state, new_state): diff --git a/homeassistant/components/calendar/todoist.py b/homeassistant/components/calendar/todoist.py index 30c5a6177b4..ba1f60027ba 100644 --- a/homeassistant/components/calendar/todoist.py +++ b/homeassistant/components/calendar/todoist.py @@ -26,9 +26,6 @@ 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 diff --git a/homeassistant/components/light/group.py b/homeassistant/components/light/group.py index f9ffbb4e0bf..b2fdd36abe7 100644 --- a/homeassistant/components/light/group.py +++ b/homeassistant/components/light/group.py @@ -254,8 +254,6 @@ def _mean_tuple(*args): return tuple(sum(l) / len(l) for l in zip(*args)) -# https://github.com/PyCQA/pylint/issues/1831 -# pylint: disable=bad-whitespace def _reduce_attribute(states: List[State], key: str, default: Optional[Any] = None, diff --git a/homeassistant/components/sensor/min_max.py b/homeassistant/components/sensor/min_max.py index 912bf7b7500..f3a30724732 100644 --- a/homeassistant/components/sensor/min_max.py +++ b/homeassistant/components/sensor/min_max.py @@ -124,7 +124,6 @@ class MinMaxSensor(Entity): self.states = {} @callback - # pylint: disable=invalid-name def async_min_max_sensor_state_listener(entity, old_state, new_state): """Handle the sensor state changes.""" if new_state.state is None or new_state.state in STATE_UNKNOWN: diff --git a/homeassistant/components/sensor/statistics.py b/homeassistant/components/sensor/statistics.py index a77509c18d4..35333090910 100644 --- a/homeassistant/components/sensor/statistics.py +++ b/homeassistant/components/sensor/statistics.py @@ -97,7 +97,6 @@ class StatisticsSensor(Entity): hass.async_add_job(self._initialize_from_database) @callback - # pylint: disable=invalid-name def async_stats_sensor_state_listener(entity, old_state, new_state): """Handle the sensor state changes.""" self._unit_of_measurement = new_state.attributes.get( diff --git a/homeassistant/helpers/template.py b/homeassistant/helpers/template.py index ea620c9bccd..d0d3fb457b1 100644 --- a/homeassistant/helpers/template.py +++ b/homeassistant/helpers/template.py @@ -142,7 +142,6 @@ class Template: self.hass.loop, self.async_render_with_possible_json_value, value, error_value).result() - # pylint: disable=invalid-name def async_render_with_possible_json_value(self, value, error_value=_SENTINEL): """Render template with value exposed. diff --git a/homeassistant/scripts/benchmark/__init__.py b/homeassistant/scripts/benchmark/__init__.py index 331b9992627..98de59f2da1 100644 --- a/homeassistant/scripts/benchmark/__init__.py +++ b/homeassistant/scripts/benchmark/__init__.py @@ -78,7 +78,6 @@ async def async_million_events(hass): @benchmark -# pylint: disable=invalid-name async def async_million_time_changed_helper(hass): """Run a million events through time changed helper.""" count = 0 @@ -109,7 +108,6 @@ async def async_million_time_changed_helper(hass): @benchmark -# pylint: disable=invalid-name async def async_million_state_changed_helper(hass): """Run a million events through state changed helper.""" count = 0 diff --git a/pylintrc b/pylintrc index 00bc6582f3a..b72502248d7 100644 --- a/pylintrc +++ b/pylintrc @@ -11,7 +11,6 @@ # too-few-* - same as too-many-* # abstract-method - with intro of async there are always methods missing # inconsistent-return-statements - doesn't handle raise -# useless-return - https://github.com/PyCQA/pylint/issues/2300 # not-an-iterable - https://github.com/PyCQA/pylint/issues/2311 disable= abstract-class-little-used, @@ -33,8 +32,7 @@ disable= too-many-public-methods, too-many-return-statements, too-many-statements, - unused-argument, - useless-return + unused-argument [REPORTS] reports=no diff --git a/requirements_test.txt b/requirements_test.txt index 225958a722c..366545831dc 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -8,7 +8,7 @@ flake8==3.5 mock-open==1.3.1 mypy==0.620 pydocstyle==1.1.1 -pylint==2.0.1 +pylint==2.1.0 pytest-aiohttp==0.3.0 pytest-cov==2.5.1 pytest-sugar==0.9.1 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 0a6c6711283..953d974f298 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -9,7 +9,7 @@ flake8==3.5 mock-open==1.3.1 mypy==0.620 pydocstyle==1.1.1 -pylint==2.0.1 +pylint==2.1.0 pytest-aiohttp==0.3.0 pytest-cov==2.5.1 pytest-sugar==0.9.1