Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump ruff from 0.4.10 to 0.6.4 #358

Merged
merged 3 commits into from
Sep 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
python-version: "3.12"
- run: python3 -m pip install poetry~=1.8
- run: poetry install
- run: poetry run ./scripts/lint
- run: poetry run ./scripts/lint --no-fix

tests:
runs-on: "ubuntu-latest"
Expand Down
37 changes: 19 additions & 18 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions scripts/lint
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,10 @@ set -e

cd "$(dirname "$0")/.."

ruff format .
ruff check . --fix
if [[ "$1" == "--no-fix" ]]; then
ruff format . --check
ruff check .
else
ruff format .
ruff check . --fix
fi
4 changes: 2 additions & 2 deletions tests/test_entity_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ async def test_entity_device_combinations(
assert as_dict["device"]["labels"] is not None
assert as_dict["device"]["labels"] == device_labels

assert {
assert snapshot == {
"source_entity": {
"entity_id": entity_object_id,
"entity_area_name": entity_area_name,
Expand All @@ -299,7 +299,7 @@ async def test_entity_device_combinations(
"device_floor_name": device_floor_name,
"device_labels": device_labels,
},
} == snapshot
}


class Test_ExtendedDeviceEntry:
Expand Down
8 changes: 4 additions & 4 deletions tests/test_es_publish_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,10 @@ async def test_init(self, manager, snapshot: SnapshotAssertion):
assert manager._poller is not None
assert manager._publisher is not None

assert {
assert snapshot == {
"settings": manager._settings.to_dict(),
"static_fields": manager._static_fields,
} == snapshot
}

async def test_async_init(self, manager, config_entry):
"""Test the async initialization of the manager."""
Expand Down Expand Up @@ -817,10 +817,10 @@ async def test_state_to_attributes_objects(self, formatter, snapshot: SnapshotAs
state = State("light.living_room", "on", orig_attributes)
transformed_attributes = formatter._state_to_attributes(state)

assert {
assert snapshot == {
"orig_attributes": orig_attributes,
"transformed_attributes": transformed_attributes,
} == snapshot
}

async def test_state_to_coerced_value_string(self, formatter):
"""Test converting a state to a coerced value."""
Expand Down
8 changes: 4 additions & 4 deletions tests/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,14 @@ def _test_config_data_options_migration_to_version(

assert end_version == after_version

assert {
assert snapshot == {
"before_data": dict(mock_entry.data),
"before_options": dict(mock_entry.options),
"before_version": mock_entry.version,
"after_data": dict(migrated_data),
"after_options": dict(migrated_options),
"after_version": end_version,
} == snapshot
}

return True

Expand Down Expand Up @@ -941,10 +941,10 @@ async def test_setup_v1_to_publish(

assert config_entry.state is ConfigEntryState.LOADED

assert {
assert snapshot == {
"data": config_entry.data,
"options": config_entry.options,
} == snapshot
}

# Queue an entity state change
hass.states.async_set(entity.entity_id, "value")
Expand Down