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 json
import logging import logging
# pylint: disable-next=no-name-in-module
from azure.servicebus import ServiceBusMessage from azure.servicebus import ServiceBusMessage
# pylint: disable-next=no-name-in-module
from azure.servicebus.aio import ServiceBusClient, ServiceBusSender from azure.servicebus.aio import ServiceBusClient, ServiceBusSender
# pylint: disable-next=no-name-in-module
from azure.servicebus.exceptions import ( from azure.servicebus.exceptions import (
MessagingEntityNotFoundError, MessagingEntityNotFoundError,
ServiceBusConnectionError, 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() discovergy_data.meters = await discovergy_data.api_client.meters()
except discovergyError.InvalidLogin as err: except discovergyError.InvalidLogin as err:
raise ConfigEntryAuthFailed("Invalid email or password") from err raise ConfigEntryAuthFailed("Invalid email or password") from err
except Exception as err: # pylint: disable=broad-except except Exception as err:
raise ConfigEntryNotReady( raise ConfigEntryNotReady(
"Unexpected error while while getting meters" "Unexpected error while while getting meters"
) from err ) from err

View file

@ -318,7 +318,7 @@ class HomeAssistantHTTP:
# By default aiohttp does a linear search for routing rules, # By default aiohttp does a linear search for routing rules,
# we have a lot of routes, so use a dict lookup with a fallback # we have a lot of routes, so use a dict lookup with a fallback
# to the linear search. # to the linear search.
self.app._router = FastUrlDispatcher() # pylint: disable=protected-access self.app._router = FastUrlDispatcher()
self.hass = hass self.hass = hass
self.ssl_certificate = ssl_certificate self.ssl_certificate = ssl_certificate
self.ssl_peer_certificate = ssl_peer_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") for x in ("MacAddress1", "MacAddress2", "WifiMacAddrWl0", "WifiMacAddrWl1")
] ]
# Assume not supported when exception is thrown # 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"]) macs.extend(x.get("WifiMac") for x in wlan_settings["Ssids"]["Ssid"])
return sorted({format_mac(str(x)) for x in macs if x}) 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]) async_add_entities([integral])
# pylint: disable-next=hass-invalid-inheritance # needs fixing
class IntegrationSensor(RestoreSensor): class IntegrationSensor(RestoreSensor):
"""Representation of an integration sensor.""" """Representation of an integration sensor."""

View file

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

View file

@ -187,8 +187,6 @@ class Filters:
if self._included_domains or self._included_entity_globs: if self._included_domains or self._included_entity_globs:
return or_( return or_(
i_entities, 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))), (~e_entities & (i_entity_globs | (~e_entity_globs & i_domains))),
).self_group() ).self_group()

View file

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

View file

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