mirror of
https://github.com/home-assistant/core.git
synced 2025-07-12 15:57:06 +00:00
Enable pylint global-statement (#33641)
This commit is contained in:
parent
187b6525b4
commit
71a47fc80c
@ -39,7 +39,7 @@ CONFIG_SCHEMA = vol.Schema(
|
|||||||
|
|
||||||
def setup(hass, config):
|
def setup(hass, config):
|
||||||
"""Use config values to set up a function enabling status retrieval."""
|
"""Use config values to set up a function enabling status retrieval."""
|
||||||
global DATA
|
global DATA # pylint: disable=global-statement
|
||||||
conf = config[DOMAIN]
|
conf = config[DOMAIN]
|
||||||
host = conf.get(CONF_HOST)
|
host = conf.get(CONF_HOST)
|
||||||
port = conf.get(CONF_PORT)
|
port = conf.get(CONF_PORT)
|
||||||
|
@ -126,7 +126,7 @@ class SharpAquosTVDevice(MediaPlayerDevice):
|
|||||||
|
|
||||||
def __init__(self, name, remote, power_on_enabled=False):
|
def __init__(self, name, remote, power_on_enabled=False):
|
||||||
"""Initialize the aquos device."""
|
"""Initialize the aquos device."""
|
||||||
global SUPPORT_SHARPTV
|
global SUPPORT_SHARPTV # pylint: disable=global-statement
|
||||||
self._power_on_enabled = power_on_enabled
|
self._power_on_enabled = power_on_enabled
|
||||||
if self._power_on_enabled:
|
if self._power_on_enabled:
|
||||||
SUPPORT_SHARPTV = SUPPORT_SHARPTV | SUPPORT_TURN_ON
|
SUPPORT_SHARPTV = SUPPORT_SHARPTV | SUPPORT_TURN_ON
|
||||||
|
@ -28,7 +28,7 @@ def setup(hass, config):
|
|||||||
|
|
||||||
port = config[DOMAIN][CONF_PORT]
|
port = config[DOMAIN][CONF_PORT]
|
||||||
|
|
||||||
global BOARD
|
global BOARD # pylint: disable=global-statement
|
||||||
try:
|
try:
|
||||||
BOARD = ArduinoBoard(port)
|
BOARD = ArduinoBoard(port)
|
||||||
except (serial.serialutil.SerialException, FileNotFoundError):
|
except (serial.serialutil.SerialException, FileNotFoundError):
|
||||||
|
@ -31,7 +31,7 @@ def setup(hass, config):
|
|||||||
"""Set up the BloomSky component."""
|
"""Set up the BloomSky component."""
|
||||||
api_key = config[DOMAIN][CONF_API_KEY]
|
api_key = config[DOMAIN][CONF_API_KEY]
|
||||||
|
|
||||||
global BLOOMSKY
|
global BLOOMSKY # pylint: disable=global-statement
|
||||||
try:
|
try:
|
||||||
BLOOMSKY = BloomSky(api_key, hass.config.units.is_metric)
|
BLOOMSKY = BloomSky(api_key, hass.config.units.is_metric)
|
||||||
except RuntimeError:
|
except RuntimeError:
|
||||||
|
@ -42,7 +42,7 @@ def setup(hass, config):
|
|||||||
host = conf.get(CONF_HOST)
|
host = conf.get(CONF_HOST)
|
||||||
port = conf.get(CONF_PORT)
|
port = conf.get(CONF_PORT)
|
||||||
|
|
||||||
global CONTROLLER
|
global CONTROLLER # pylint: disable=global-statement
|
||||||
try:
|
try:
|
||||||
CONTROLLER = MochadCtrl(host, port)
|
CONTROLLER = MochadCtrl(host, port)
|
||||||
except exceptions.ConfigurationError:
|
except exceptions.ConfigurationError:
|
||||||
|
@ -34,7 +34,7 @@ SCSGATE_SCHEMA = vol.Schema(
|
|||||||
def setup(hass, config):
|
def setup(hass, config):
|
||||||
"""Set up the SCSGate component."""
|
"""Set up the SCSGate component."""
|
||||||
device = config[DOMAIN][CONF_DEVICE]
|
device = config[DOMAIN][CONF_DEVICE]
|
||||||
global SCSGATE
|
global SCSGATE # pylint: disable=global-statement
|
||||||
|
|
||||||
try:
|
try:
|
||||||
SCSGATE = SCSGate(device=device, logger=_LOGGER)
|
SCSGATE = SCSGate(device=device, logger=_LOGGER)
|
||||||
|
@ -46,7 +46,7 @@ def setup(hass, config):
|
|||||||
Will automatically load sensor components to support
|
Will automatically load sensor components to support
|
||||||
devices discovered on the account.
|
devices discovered on the account.
|
||||||
"""
|
"""
|
||||||
global DATA
|
global DATA # pylint: disable=global-statement
|
||||||
|
|
||||||
username = config[DOMAIN][CONF_USERNAME]
|
username = config[DOMAIN][CONF_USERNAME]
|
||||||
password = config[DOMAIN][CONF_PASSWORD]
|
password = config[DOMAIN][CONF_PASSWORD]
|
||||||
|
@ -75,7 +75,7 @@ DEVICE_SERIAL_SCHEMA = vol.Schema({vol.Required(ATTR_DEVICE_SERIAL): cv.string})
|
|||||||
|
|
||||||
def setup(hass, config):
|
def setup(hass, config):
|
||||||
"""Set up the Verisure component."""
|
"""Set up the Verisure component."""
|
||||||
global HUB
|
global HUB # pylint: disable=global-statement
|
||||||
HUB = VerisureHub(config[DOMAIN])
|
HUB = VerisureHub(config[DOMAIN])
|
||||||
HUB.update_overview = Throttle(config[DOMAIN][CONF_SCAN_INTERVAL])(
|
HUB.update_overview = Throttle(config[DOMAIN][CONF_SCAN_INTERVAL])(
|
||||||
HUB.update_overview
|
HUB.update_overview
|
||||||
|
@ -71,15 +71,15 @@ PLATFORM_SCHEMA = vol.Schema(
|
|||||||
|
|
||||||
def setup(hass, config):
|
def setup(hass, config):
|
||||||
"""Set up the connection to the Zigbee device."""
|
"""Set up the connection to the Zigbee device."""
|
||||||
global DEVICE
|
global DEVICE # pylint: disable=global-statement
|
||||||
global GPIO_DIGITAL_OUTPUT_LOW
|
global GPIO_DIGITAL_OUTPUT_LOW # pylint: disable=global-statement
|
||||||
global GPIO_DIGITAL_OUTPUT_HIGH
|
global GPIO_DIGITAL_OUTPUT_HIGH # pylint: disable=global-statement
|
||||||
global ADC_PERCENTAGE
|
global ADC_PERCENTAGE # pylint: disable=global-statement
|
||||||
global DIGITAL_PINS
|
global DIGITAL_PINS # pylint: disable=global-statement
|
||||||
global ANALOG_PINS
|
global ANALOG_PINS # pylint: disable=global-statement
|
||||||
global CONVERT_ADC
|
global CONVERT_ADC # pylint: disable=global-statement
|
||||||
global ZIGBEE_EXCEPTION
|
global ZIGBEE_EXCEPTION # pylint: disable=global-statement
|
||||||
global ZIGBEE_TX_FAILURE
|
global ZIGBEE_TX_FAILURE # pylint: disable=global-statement
|
||||||
|
|
||||||
GPIO_DIGITAL_OUTPUT_LOW = xb_const.GPIO_DIGITAL_OUTPUT_LOW
|
GPIO_DIGITAL_OUTPUT_LOW = xb_const.GPIO_DIGITAL_OUTPUT_LOW
|
||||||
GPIO_DIGITAL_OUTPUT_HIGH = xb_const.GPIO_DIGITAL_OUTPUT_HIGH
|
GPIO_DIGITAL_OUTPUT_HIGH = xb_const.GPIO_DIGITAL_OUTPUT_HIGH
|
||||||
|
@ -31,7 +31,7 @@ def set_default_time_zone(time_zone: dt.tzinfo) -> None:
|
|||||||
|
|
||||||
Async friendly.
|
Async friendly.
|
||||||
"""
|
"""
|
||||||
global DEFAULT_TIME_ZONE
|
global DEFAULT_TIME_ZONE # pylint: disable=global-statement
|
||||||
|
|
||||||
# NOTE: Remove in the future in favour of typing
|
# NOTE: Remove in the future in favour of typing
|
||||||
assert isinstance(time_zone, dt.tzinfo)
|
assert isinstance(time_zone, dt.tzinfo)
|
||||||
|
@ -295,7 +295,7 @@ def secret_yaml(loader: SafeLineLoader, node: yaml.nodes.Node) -> JSON_TYPE:
|
|||||||
_LOGGER.debug("Secret %s retrieved from keyring", node.value)
|
_LOGGER.debug("Secret %s retrieved from keyring", node.value)
|
||||||
return pwd
|
return pwd
|
||||||
|
|
||||||
global credstash # pylint: disable=invalid-name
|
global credstash # pylint: disable=invalid-name, global-statement
|
||||||
|
|
||||||
if credstash:
|
if credstash:
|
||||||
# pylint: disable=no-member
|
# pylint: disable=no-member
|
||||||
|
1
pylintrc
1
pylintrc
@ -34,7 +34,6 @@ disable=
|
|||||||
abstract-method,
|
abstract-method,
|
||||||
cyclic-import,
|
cyclic-import,
|
||||||
duplicate-code,
|
duplicate-code,
|
||||||
global-statement,
|
|
||||||
inconsistent-return-statements,
|
inconsistent-return-statements,
|
||||||
locally-disabled,
|
locally-disabled,
|
||||||
not-context-manager,
|
not-context-manager,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user