Remove pylint configs flagged by useless-suppression (#99081)

This commit is contained in:
Ville Skyttä 2023-08-26 17:46:03 +03:00 committed by GitHub
parent a25a7ebbeb
commit c287bd1a3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 5 additions and 15 deletions

View File

@ -4,13 +4,8 @@ from __future__ import annotations
import json
import logging
# pylint: disable-next=no-name-in-module
from azure.servicebus import ServiceBusMessage
# pylint: disable-next=no-name-in-module
from azure.servicebus.aio import ServiceBusClient, ServiceBusSender
# pylint: disable-next=no-name-in-module
from azure.servicebus.exceptions import (
MessagingEntityNotFoundError,
ServiceBusConnectionError,

View File

@ -51,7 +51,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
discovergy_data.meters = await discovergy_data.api_client.meters()
except discovergyError.InvalidLogin as err:
raise ConfigEntryAuthFailed("Invalid email or password") from err
except Exception as err: # pylint: disable=broad-except
except Exception as err:
raise ConfigEntryNotReady(
"Unexpected error while while getting meters"
) from err

View File

@ -318,7 +318,7 @@ class HomeAssistantHTTP:
# By default aiohttp does a linear search for routing rules,
# we have a lot of routes, so use a dict lookup with a fallback
# to the linear search.
self.app._router = FastUrlDispatcher() # pylint: disable=protected-access
self.app._router = FastUrlDispatcher()
self.hass = hass
self.ssl_certificate = ssl_certificate
self.ssl_peer_certificate = ssl_peer_certificate

View File

@ -21,7 +21,7 @@ def get_device_macs(
for x in ("MacAddress1", "MacAddress2", "WifiMacAddrWl0", "WifiMacAddrWl1")
]
# Assume not supported when exception is thrown
with suppress(Exception): # pylint: disable=broad-except
with suppress(Exception):
macs.extend(x.get("WifiMac") for x in wlan_settings["Ssids"]["Ssid"])
return sorted({format_mac(str(x)) for x in macs if x})

View File

@ -207,7 +207,6 @@ async def async_setup_platform(
async_add_entities([integral])
# pylint: disable-next=hass-invalid-inheritance # needs fixing
class IntegrationSensor(RestoreSensor):
"""Representation of an integration sensor."""

View File

@ -247,7 +247,7 @@ class MqttValueTemplate:
payload, variables=values
)
)
except Exception as ex: # pylint: disable=broad-except
except Exception as ex:
_LOGGER.error(
"%s: %s rendering template for entity '%s', template: '%s'",
type(ex).__name__,
@ -274,7 +274,7 @@ class MqttValueTemplate:
payload, default, variables=values
)
)
except Exception as ex: # pylint: disable=broad-except
except Exception as ex:
_LOGGER.error(
"%s: %s rendering template for entity '%s', template: "
"'%s', default value: %s and payload: %s",

View File

@ -187,8 +187,6 @@ class Filters:
if self._included_domains or self._included_entity_globs:
return or_(
i_entities,
# https://github.com/sqlalchemy/sqlalchemy/issues/9190
# pylint: disable-next=invalid-unary-operand-type
(~e_entities & (i_entity_globs | (~e_entity_globs & i_domains))),
).self_group()

View File

@ -548,7 +548,6 @@ class SamsungTVWSBridge(
return RESULT_AUTH_MISSING
except (ConnectionFailure, OSError, AsyncioTimeoutError) as err:
LOGGER.debug("Failing config: %s, %s error: %s", config, type(err), err)
# pylint: disable-next=useless-else-on-loop
else: # noqa: PLW0120
if result:
return result

View File

@ -102,7 +102,6 @@ async def discover_devices(hass, hass_config):
async with asyncio.timeout(SCAN_INTERVAL.total_seconds()):
channels = {
channel["id"]: channel
# pylint: disable-next=cell-var-from-loop
for channel in await server.get_channels( # noqa: B023
include=["iodevice", "state", "connected"]
)