diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 93fa660ac9b..5797fe16565 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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] diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index fab04fe3972..45dd06fbe7e 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -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. diff --git a/homeassistant/components/coinbase/const.py b/homeassistant/components/coinbase/const.py index 3fc8158f970..193913e4b6f 100644 --- a/homeassistant/components/coinbase/const.py +++ b/homeassistant/components/coinbase/const.py @@ -550,7 +550,7 @@ RATES = { "TRAC": "TRAC", "TRB": "TRB", "TRIBE": "TRIBE", - "TRU": "TRU", + "TRU": "TRU", # codespell:ignore tru "TRY": "TRY", "TTD": "TTD", "TWD": "TWD", diff --git a/homeassistant/components/homekit_controller/connection.py b/homeassistant/components/homekit_controller/connection.py index 2479dc3c181..8c513805641 100644 --- a/homeassistant/components/homekit_controller/connection.py +++ b/homeassistant/components/homekit_controller/connection.py @@ -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 diff --git a/homeassistant/components/isy994/binary_sensor.py b/homeassistant/components/isy994/binary_sensor.py index c130ba32746..179944ad35f 100644 --- a/homeassistant/components/isy994/binary_sensor.py +++ b/homeassistant/components/isy994/binary_sensor.py @@ -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: diff --git a/homeassistant/components/jewish_calendar/sensor.py b/homeassistant/components/jewish_calendar/sensor.py index 2a16ecb9c14..bdfee08aa08 100644 --- a/homeassistant/components/jewish_calendar/sensor.py +++ b/homeassistant/components/jewish_calendar/sensor.py @@ -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". diff --git a/homeassistant/components/systemmonitor/binary_sensor.py b/homeassistant/components/systemmonitor/binary_sensor.py index 157ec54920b..aecd30765ff 100644 --- a/homeassistant/components/systemmonitor/binary_sensor.py +++ b/homeassistant/components/systemmonitor/binary_sensor.py @@ -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( diff --git a/homeassistant/components/systemmonitor/sensor.py b/homeassistant/components/systemmonitor/sensor.py index 947f637c572..3634820ba30 100644 --- a/homeassistant/components/systemmonitor/sensor.py +++ b/homeassistant/components/systemmonitor/sensor.py @@ -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() diff --git a/homeassistant/components/transmission/config_flow.py b/homeassistant/components/transmission/config_flow.py index 62879d2d0af..2a4fd5aae0b 100644 --- a/homeassistant/components/transmission/config_flow.py +++ b/homeassistant/components/transmission/config_flow.py @@ -1,4 +1,4 @@ -"""Config flow for Transmission Bittorent Client.""" +"""Config flow for Transmission Bittorrent Client.""" from __future__ import annotations diff --git a/homeassistant/components/transmission/const.py b/homeassistant/components/transmission/const.py index 0dd77fa6aa3..120918b24a2 100644 --- a/homeassistant/components/transmission/const.py +++ b/homeassistant/components/transmission/const.py @@ -1,4 +1,4 @@ -"""Constants for the Transmission Bittorent Client component.""" +"""Constants for the Transmission Bittorrent Client component.""" from __future__ import annotations diff --git a/pyproject.toml b/pyproject.toml index b7904fc8aa1..1a6ce24871c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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", diff --git a/requirements_test_pre_commit.txt b/requirements_test_pre_commit.txt index 53d9cec3225..ed14959e096 100644 --- a/requirements_test_pre_commit.txt +++ b/requirements_test_pre_commit.txt @@ -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 diff --git a/script/lint_and_test.py b/script/lint_and_test.py index 393c5961c7a..e23870364b6 100755 --- a/script/lint_and_test.py +++ b/script/lint_and_test.py @@ -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) diff --git a/script/translations/clean.py b/script/translations/clean.py index 0403e04f789..72bb79f1f0c 100644 --- a/script/translations/clean.py +++ b/script/translations/clean.py @@ -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: diff --git a/script/translations/migrate.py b/script/translations/migrate.py index 0f51e49c5a9..9ff45104b48 100644 --- a/script/translations/migrate.py +++ b/script/translations/migrate.py @@ -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)) diff --git a/tests/components/dlna_dmr/test_media_player.py b/tests/components/dlna_dmr/test_media_player.py index 87c54c2956b..224046dcef5 100644 --- a/tests/components/dlna_dmr/test_media_player.py +++ b/tests/components/dlna_dmr/test_media_player.py @@ -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:*", ] diff --git a/tests/components/google_assistant/test_smart_home.py b/tests/components/google_assistant/test_smart_home.py index 04ceafb004a..962842cae31 100644 --- a/tests/components/google_assistant/test_smart_home.py +++ b/tests/components/google_assistant/test_smart_home.py @@ -1281,7 +1281,7 @@ async def test_identify(hass: HomeAssistant) -> None: "payload": { "device": { "mdnsScanData": { - "additionals": [ + "additionals": [ # codespell:ignore additionals { "type": "TXT", "class": "IN", diff --git a/tests/components/idasen_desk/test_init.py b/tests/components/idasen_desk/test_init.py index 0973e8326bf..60f1fb3e5e3 100644 --- a/tests/components/idasen_desk/test_init.py +++ b/tests/components/idasen_desk/test_init.py @@ -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: diff --git a/tests/components/mqtt/test_init.py b/tests/components/mqtt/test_init.py index b71a105b7bc..358d6432f83 100644 --- a/tests/components/mqtt/test_init.py +++ b/tests/components/mqtt/test_init.py @@ -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)] diff --git a/tests/components/mqtt/test_siren.py b/tests/components/mqtt/test_siren.py index 77bec4accfb..bb4b103225e 100644 --- a/tests/components/mqtt/test_siren.py +++ b/tests/components/mqtt/test_siren.py @@ -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}', diff --git a/tests/components/utility_meter/test_sensor.py b/tests/components/utility_meter/test_sensor.py index ad118d424eb..00769998ff5 100644 --- a/tests/components/utility_meter/test_sensor.py +++ b/tests/components/utility_meter/test_sensor.py @@ -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() diff --git a/tests/util/test_executor.py b/tests/util/test_executor.py index 0730c16b68d..b0898ccc150 100644 --- a/tests/util/test_executor.py +++ b/tests/util/test_executor.py @@ -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.