Update codespell to 2.3.0 (#118001)

This commit is contained in:
Marc Mueller 2024-05-24 08:22:29 +02:00 committed by GitHub
parent 93daac9b3d
commit dc47792ff2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 29 additions and 28 deletions

View file

@ -8,11 +8,11 @@ repos:
- id: ruff-format - id: ruff-format
files: ^((homeassistant|pylint|script|tests)/.+)?[^/]+\.(py|pyi)$ files: ^((homeassistant|pylint|script|tests)/.+)?[^/]+\.(py|pyi)$
- repo: https://github.com/codespell-project/codespell - repo: https://github.com/codespell-project/codespell
rev: v2.2.6 rev: v2.3.0
hooks: hooks:
- id: codespell - id: codespell
args: args:
- --ignore-words-list=additionals,alle,alot,astroid,bund,caf,convencional,currenty,datas,farenheit,falsy,fo,frequence,haa,hass,iif,incomfort,ines,ist,nam,nd,pres,pullrequests,resset,rime,ser,serie,te,technik,ue,unsecure,vor,withing,zar - --ignore-words-list=additionals,alle,alot,astroid,bund,caf,checkin,convencional,currenty,datas,farenheit,falsy,fo,frequence,haa,hass,iif,incomfort,ines,ist,lookin,nam,nd,NotIn,pres,pullrequests,resset,rime,ser,serie,te,technik,ue,unsecure,vor,withing,zar
- --skip="./.*,*.csv,*.json,*.ambr" - --skip="./.*,*.csv,*.json,*.ambr"
- --quiet-level=2 - --quiet-level=2
exclude_types: [csv, json, html] exclude_types: [csv, json, html]

View file

@ -5,7 +5,7 @@
We as members, contributors, and leaders pledge to make participation in our We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status, identity and expression, level of experience, education, socioeconomic status,
nationality, personal appearance, race, religion, or sexual identity nationality, personal appearance, race, religion, or sexual identity
and orientation. and orientation.

View file

@ -550,7 +550,7 @@ RATES = {
"TRAC": "TRAC", "TRAC": "TRAC",
"TRB": "TRB", "TRB": "TRB",
"TRIBE": "TRIBE", "TRIBE": "TRIBE",
"TRU": "TRU", "TRU": "TRU", # codespell:ignore tru
"TRY": "TRY", "TRY": "TRY",
"TTD": "TTD", "TTD": "TTD",
"TWD": "TWD", "TWD": "TWD",

View file

@ -110,7 +110,7 @@ class HKDevice:
# A list of callbacks that turn HK characteristics into entities # A list of callbacks that turn HK characteristics into entities
self.char_factories: list[AddCharacteristicCb] = [] self.char_factories: list[AddCharacteristicCb] = []
# The platorms we have forwarded the config entry so far. If a new # The platforms we have forwarded the config entry so far. If a new
# accessory is added to a bridge we may have to load additional # accessory is added to a bridge we may have to load additional
# platforms. We don't want to load all platforms up front if its just # platforms. We don't want to load all platforms up front if its just
# a lightbulb. And we don't want to forward a config entry twice # a lightbulb. And we don't want to forward a config entry twice

View file

@ -447,7 +447,7 @@ class ISYBinarySensorHeartbeat(ISYNodeEntity, BinarySensorEntity, RestoreEntity)
self._node.control_events.subscribe(self._heartbeat_node_control_handler) self._node.control_events.subscribe(self._heartbeat_node_control_handler)
# Start the timer on bootup, so we can change from UNKNOWN to OFF # Start the timer on boot-up, so we can change from UNKNOWN to OFF
self._restart_timer() self._restart_timer()
if (last_state := await self.async_get_last_state()) is not None: if (last_state := await self.async_get_last_state()) is not None:

View file

@ -202,8 +202,9 @@ class JewishCalendarSensor(SensorEntity):
daytime_date = HDate(today, diaspora=self._diaspora, hebrew=self._hebrew) daytime_date = HDate(today, diaspora=self._diaspora, hebrew=self._hebrew)
# The Jewish day starts after darkness (called "tzais") and finishes at # The Jewish day starts after darkness (called "tzais") and finishes at
# sunset ("shkia"). The time in between is a gray area (aka "Bein # sunset ("shkia"). The time in between is a gray area
# Hashmashot" - literally: "in between the sun and the moon"). # (aka "Bein Hashmashot" # codespell:ignore
# - literally: "in between the sun and the moon").
# For some sensors, it is more interesting to consider the date to be # For some sensors, it is more interesting to consider the date to be
# tomorrow based on sunset ("shkia"), for others based on "tzais". # tomorrow based on sunset ("shkia"), for others based on "tzais".

View file

@ -93,7 +93,7 @@ async def async_setup_entry(
entry: SystemMonitorConfigEntry, entry: SystemMonitorConfigEntry,
async_add_entities: AddEntitiesCallback, async_add_entities: AddEntitiesCallback,
) -> None: ) -> None:
"""Set up System Montor binary sensors based on a config entry.""" """Set up System Monitor binary sensors based on a config entry."""
coordinator = entry.runtime_data.coordinator coordinator = entry.runtime_data.coordinator
async_add_entities( async_add_entities(

View file

@ -506,7 +506,7 @@ async def async_setup_entry(
entry: SystemMonitorConfigEntry, entry: SystemMonitorConfigEntry,
async_add_entities: AddEntitiesCallback, async_add_entities: AddEntitiesCallback,
) -> None: ) -> None:
"""Set up System Montor sensors based on a config entry.""" """Set up System Monitor sensors based on a config entry."""
entities: list[SystemMonitorSensor] = [] entities: list[SystemMonitorSensor] = []
legacy_resources: set[str] = set(entry.options.get("resources", [])) legacy_resources: set[str] = set(entry.options.get("resources", []))
loaded_resources: set[str] = set() loaded_resources: set[str] = set()

View file

@ -1,4 +1,4 @@
"""Config flow for Transmission Bittorent Client.""" """Config flow for Transmission Bittorrent Client."""
from __future__ import annotations from __future__ import annotations

View file

@ -1,4 +1,4 @@
"""Constants for the Transmission Bittorent Client component.""" """Constants for the Transmission Bittorrent Client component."""
from __future__ import annotations from __future__ import annotations

View file

@ -564,7 +564,7 @@ filterwarnings = [
# https://github.com/tomaszsluszniak/sanix_py/blob/v1.0.6/sanix/__init__.py#L42 # https://github.com/tomaszsluszniak/sanix_py/blob/v1.0.6/sanix/__init__.py#L42
"ignore:invalid escape sequence:SyntaxWarning:.*sanix", "ignore:invalid escape sequence:SyntaxWarning:.*sanix",
# https://pypi.org/project/sleekxmppfs/ - v1.4.1 - 2022-08-18 # https://pypi.org/project/sleekxmppfs/ - v1.4.1 - 2022-08-18
"ignore:invalid escape sequence:SyntaxWarning:.*sleekxmppfs.thirdparty.mini_dateutil", "ignore:invalid escape sequence:SyntaxWarning:.*sleekxmppfs.thirdparty.mini_dateutil", # codespell:ignore thirdparty
# https://pypi.org/project/vobject/ - v0.9.7 - 2024-03-25 # https://pypi.org/project/vobject/ - v0.9.7 - 2024-03-25
# https://github.com/py-vobject/vobject # https://github.com/py-vobject/vobject
"ignore:invalid escape sequence:SyntaxWarning:.*vobject.base", "ignore:invalid escape sequence:SyntaxWarning:.*vobject.base",

View file

@ -1,5 +1,5 @@
# Automatically generated from .pre-commit-config.yaml by gen_requirements_all.py, do not edit # Automatically generated from .pre-commit-config.yaml by gen_requirements_all.py, do not edit
codespell==2.2.6 codespell==2.3.0
ruff==0.4.5 ruff==0.4.5
yamllint==1.35.1 yamllint==1.35.1

View file

@ -81,7 +81,7 @@ async def async_exec(*args, display=False):
raise raise
if not display: if not display:
# Readin stdout into log # Reading stdout into log
stdout, _ = await proc.communicate() stdout, _ = await proc.communicate()
else: else:
# read child's stdout/stderr concurrently (capture and display) # read child's stdout/stderr concurrently (capture and display)

View file

@ -100,7 +100,7 @@ def run():
key_data = lokalise.keys_list({"filter_keys": ",".join(chunk), "limit": 1000}) key_data = lokalise.keys_list({"filter_keys": ",".join(chunk), "limit": 1000})
if len(key_data) != len(chunk): if len(key_data) != len(chunk):
print( print(
f"Lookin up key in Lokalise returns {len(key_data)} results, expected {len(chunk)}" f"Looking up key in Lokalise returns {len(key_data)} results, expected {len(chunk)}"
) )
if not key_data: if not key_data:

View file

@ -29,7 +29,7 @@ def rename_keys(project_id, to_migrate):
from_key_data = lokalise.keys_list({"filter_keys": ",".join(to_migrate)}) from_key_data = lokalise.keys_list({"filter_keys": ",".join(to_migrate)})
if len(from_key_data) != len(to_migrate): if len(from_key_data) != len(to_migrate):
print( print(
f"Lookin up keys in Lokalise returns {len(from_key_data)} results, expected {len(to_migrate)}" f"Looking up keys in Lokalise returns {len(from_key_data)} results, expected {len(to_migrate)}"
) )
return return
@ -72,7 +72,7 @@ def list_keys_helper(lokalise, keys, params={}, *, validate=True):
continue continue
print( print(
f"Lookin up keys in Lokalise returns {len(from_key_data)} results, expected {len(keys)}" f"Looking up keys in Lokalise returns {len(from_key_data)} results, expected {len(keys)}"
) )
searched = set(filter_keys) searched = set(filter_keys)
returned = set(create_lookup(from_key_data)) returned = set(create_lookup(from_key_data))

View file

@ -1105,7 +1105,7 @@ async def test_browse_media(
assert expected_child_audio in response["result"]["children"] assert expected_child_audio in response["result"]["children"]
# Device specifies extra parameters in MIME type, uses non-standard "x-" # Device specifies extra parameters in MIME type, uses non-standard "x-"
# prefix, and capitilizes things, all of which should be ignored # prefix, and capitalizes things, all of which should be ignored
dmr_device_mock.sink_protocol_info = [ dmr_device_mock.sink_protocol_info = [
"http-get:*:audio/X-MPEG;codecs=mp3:*", "http-get:*:audio/X-MPEG;codecs=mp3:*",
] ]

View file

@ -1281,7 +1281,7 @@ async def test_identify(hass: HomeAssistant) -> None:
"payload": { "payload": {
"device": { "device": {
"mdnsScanData": { "mdnsScanData": {
"additionals": [ "additionals": [ # codespell:ignore additionals
{ {
"type": "TXT", "type": "TXT",
"class": "IN", "class": "IN",

View file

@ -57,7 +57,7 @@ async def test_no_ble_device(hass: HomeAssistant, mock_desk_api: MagicMock) -> N
async def test_reconnect_on_bluetooth_callback( async def test_reconnect_on_bluetooth_callback(
hass: HomeAssistant, mock_desk_api: MagicMock hass: HomeAssistant, mock_desk_api: MagicMock
) -> None: ) -> None:
"""Test that a reconnet is made after the bluetooth callback is triggered.""" """Test that a reconnect is made after the bluetooth callback is triggered."""
with mock.patch( with mock.patch(
"homeassistant.components.idasen_desk.bluetooth.async_register_callback" "homeassistant.components.idasen_desk.bluetooth.async_register_callback"
) as mock_register_callback: ) as mock_register_callback:

View file

@ -1854,7 +1854,7 @@ async def test_restore_all_active_subscriptions_on_reconnect(
async_fire_time_changed(hass) # cooldown async_fire_time_changed(hass) # cooldown
await hass.async_block_till_done() await hass.async_block_till_done()
# the subscribtion with the highest QoS should survive # the subscription with the highest QoS should survive
expected = [ expected = [
call([("test/state", 2)]), call([("test/state", 2)]),
] ]
@ -1919,7 +1919,7 @@ async def test_subscribed_at_highest_qos(
freezer.tick(5) freezer.tick(5)
async_fire_time_changed(hass) # cooldown async_fire_time_changed(hass) # cooldown
await hass.async_block_till_done() await hass.async_block_till_done()
# the subscribtion with the highest QoS should survive # the subscription with the highest QoS should survive
assert help_all_subscribe_calls(mqtt_client_mock) == [("test/state", 2)] assert help_all_subscribe_calls(mqtt_client_mock) == [("test/state", 2)]

View file

@ -1118,7 +1118,7 @@ async def test_unload_entry(
'{"state":"ON","tone":"siren"}', '{"state":"ON","tone":"siren"}',
'{"state":"OFF","tone":"siren"}', '{"state":"OFF","tone":"siren"}',
), ),
# Attriute volume_level 2 is invalid, but the state is valid and should update # Attribute volume_level 2 is invalid, but the state is valid and should update
( (
"test-topic", "test-topic",
'{"state":"ON","volume_level":0.5}', '{"state":"ON","volume_level":0.5}',

View file

@ -351,7 +351,7 @@ async def test_state_always_available(
], ],
) )
async def test_not_unique_tariffs(hass: HomeAssistant, yaml_config) -> None: async def test_not_unique_tariffs(hass: HomeAssistant, yaml_config) -> None:
"""Test utility sensor state initializtion.""" """Test utility sensor state initialization."""
assert not await async_setup_component(hass, DOMAIN, yaml_config) assert not await async_setup_component(hass, DOMAIN, yaml_config)
@ -385,7 +385,7 @@ async def test_not_unique_tariffs(hass: HomeAssistant, yaml_config) -> None:
], ],
) )
async def test_init(hass: HomeAssistant, yaml_config, config_entry_config) -> None: async def test_init(hass: HomeAssistant, yaml_config, config_entry_config) -> None:
"""Test utility sensor state initializtion.""" """Test utility sensor state initialization."""
if yaml_config: if yaml_config:
assert await async_setup_component(hass, DOMAIN, yaml_config) assert await async_setup_component(hass, DOMAIN, yaml_config)
await hass.async_block_till_done() await hass.async_block_till_done()
@ -497,7 +497,7 @@ async def test_unique_id(
], ],
) )
async def test_entity_name(hass: HomeAssistant, yaml_config, entity_id, name) -> None: async def test_entity_name(hass: HomeAssistant, yaml_config, entity_id, name) -> None:
"""Test utility sensor state initializtion.""" """Test utility sensor state initialization."""
assert await async_setup_component(hass, DOMAIN, yaml_config) assert await async_setup_component(hass, DOMAIN, yaml_config)
await hass.async_block_till_done() await hass.async_block_till_done()

View file

@ -85,7 +85,7 @@ async def test_overall_timeout_reached(caplog: pytest.LogCaptureFixture) -> None
iexecutor.shutdown() iexecutor.shutdown()
finish = time.monotonic() finish = time.monotonic()
# Idealy execution time (finish - start) should be < 1.2 sec. # Ideally execution time (finish - start) should be < 1.2 sec.
# CI tests might not run in an ideal environment and timing might # CI tests might not run in an ideal environment and timing might
# not be accurate, so we let this test pass # not be accurate, so we let this test pass
# if the duration is below 3 seconds. # if the duration is below 3 seconds.