diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 93fa660ac9b2671d8eed993be1e005acc55e1b2b..5797fe165655d58244e11043b4028825b457f97a 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 fab04fe39729d70ee8bfc332731667ff691c0c74..45dd06fbe7eb04d26d12952d35965a5908f9652d 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 3fc8158f9709f29e873b2a281463d1a899292f9c..193913e4b6f49bbef205d1996927c0208ed93017 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 2479dc3c181e7fd896fea4e93280a9e1e867ac4a..8c513805641a989bdc1ef6ed7d1a0837f3bb1f7c 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 c130ba32746e47be95cf092d37f6d0636d8dea0f..179944ad35fe629a8d48a5e666e4860acc6c2954 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 2a16ecb9c145e3517e842d889b1282e83fd4b1f5..bdfee08aa0822546f6a7261a415390c725e83438 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 157ec54920be31da9ce0f3803497afb1b1423866..aecd30765ff7248c9cfae2314a31f00fb288ca90 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 947f637c572261397580218bae3103a2bf76344f..3634820ba3009a03a86af2f960e2b339290e82fa 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 62879d2d0afbb227dd3059659628554815219b88..2a4fd5aae0be8e7e36b5e8d7884d0dfb0fe81de8 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 0dd77fa6aa37187ab99ea24230ab6ecf92f75b9a..120918b24a20089a1cb8c4ce7fb0a89724c2a467 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 b7904fc8aa12ef7d4b59f8e04c6dac74650a6c8a..1a6ce24871c95664ff575dfe1ca9ebb0477e226f 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 53d9cec3225bdf52c20ed3304c547c89eb993c86..ed14959e09618a48b62ea47b9f7de6128a27ff26 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 393c5961c7ab698463b38991416cc0582baca373..e23870364b6307b9b83521b54288cb832beddeb7 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 0403e04f7899b8df52f0d60799a904bd296c6423..72bb79f1f0cdeb18e376a73068b6d97a74174d3c 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 0f51e49c5a96ab875eeb2b45524ce5487e67177c..9ff45104b48fa08350a7f7ad05e5a754767fb9d8 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 87c54c2956bec5d408554e7d2bb33ebca40880d7..224046dcef57958e6658e11a720fe7ef88ab0120 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 04ceafb004a8b715de9a1abc4cce73d20c398c40..962842cae31473ffd5acf3943ecccb02a73bdce3 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 0973e8326bfc9f5f44ac536f0b59e96237739351..60f1fb3e5e381378897df34f973a5b1bfc6caf1b 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 b71a105b7bcb6b8123226d8074da22084a427f71..358d6432f830ca5d0c2571f94c48a87f91a78b9b 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 77bec4accfbc528bde3c91e82a4052a27ba70409..bb4b103225ee9e598fb6991a5f67f851c942c88b 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 ad118d424ebe02eca059bd23427c242f1e14c903..00769998ff5bc7a4e243a0d4256e7775bee61868 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 0730c16b68de8e9721d6aed1ff507eafa20eb6dd..b0898ccc1509a0fde56538c097a31aa2f92366fd 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.