1
0
mirror of https://github.com/home-assistant/core synced 2024-06-29 06:15:03 +00:00

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
files: ^((homeassistant|pylint|script|tests)/.+)?[^/]+\.(py|pyi)$
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
rev: v2.3.0
hooks:
- id: codespell
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"
- --quiet-level=2
exclude_types: [csv, json, html]

View File

@ -5,7 +5,7 @@
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
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
and orientation.

View File

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

View File

@ -110,7 +110,7 @@ class HKDevice:
# A list of callbacks that turn HK characteristics into entities
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
# 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

View File

@ -447,7 +447,7 @@ class ISYBinarySensorHeartbeat(ISYNodeEntity, BinarySensorEntity, RestoreEntity)
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()
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)
# The Jewish day starts after darkness (called "tzais") and finishes at
# sunset ("shkia"). The time in between is a gray area (aka "Bein
# Hashmashot" - literally: "in between the sun and the moon").
# sunset ("shkia"). The time in between is a gray area
# (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
# tomorrow based on sunset ("shkia"), for others based on "tzais".

View File

@ -93,7 +93,7 @@ async def async_setup_entry(
entry: SystemMonitorConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> 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
async_add_entities(

View File

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

View File

@ -1,4 +1,4 @@
"""Constants for the Transmission Bittorent Client component."""
"""Constants for the Transmission Bittorrent Client component."""
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
"ignore:invalid escape sequence:SyntaxWarning:.*sanix",
# 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://github.com/py-vobject/vobject
"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
codespell==2.2.6
codespell==2.3.0
ruff==0.4.5
yamllint==1.35.1

View File

@ -81,7 +81,7 @@ async def async_exec(*args, display=False):
raise
if not display:
# Readin stdout into log
# Reading stdout into log
stdout, _ = await proc.communicate()
else:
# 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})
if len(key_data) != len(chunk):
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:

View File

@ -29,7 +29,7 @@ def rename_keys(project_id, to_migrate):
from_key_data = lokalise.keys_list({"filter_keys": ",".join(to_migrate)})
if len(from_key_data) != len(to_migrate):
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
@ -72,7 +72,7 @@ def list_keys_helper(lokalise, keys, params={}, *, validate=True):
continue
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)
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"]
# 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 = [
"http-get:*:audio/X-MPEG;codecs=mp3:*",
]

View File

@ -1281,7 +1281,7 @@ async def test_identify(hass: HomeAssistant) -> None:
"payload": {
"device": {
"mdnsScanData": {
"additionals": [
"additionals": [ # codespell:ignore additionals
{
"type": "TXT",
"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(
hass: HomeAssistant, mock_desk_api: MagicMock
) -> 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(
"homeassistant.components.idasen_desk.bluetooth.async_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
await hass.async_block_till_done()
# the subscribtion with the highest QoS should survive
# the subscription with the highest QoS should survive
expected = [
call([("test/state", 2)]),
]
@ -1919,7 +1919,7 @@ async def test_subscribed_at_highest_qos(
freezer.tick(5)
async_fire_time_changed(hass) # cooldown
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)]

View File

@ -1118,7 +1118,7 @@ async def test_unload_entry(
'{"state":"ON","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",
'{"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:
"""Test utility sensor state initializtion."""
"""Test utility sensor state initialization."""
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:
"""Test utility sensor state initializtion."""
"""Test utility sensor state initialization."""
if yaml_config:
assert await async_setup_component(hass, DOMAIN, yaml_config)
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:
"""Test utility sensor state initializtion."""
"""Test utility sensor state initialization."""
assert await async_setup_component(hass, DOMAIN, yaml_config)
await hass.async_block_till_done()

View File

@ -85,7 +85,7 @@ async def test_overall_timeout_reached(caplog: pytest.LogCaptureFixture) -> None
iexecutor.shutdown()
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
# not be accurate, so we let this test pass
# if the duration is below 3 seconds.