1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-30 14:43:51 +00:00

[ruff] Enable RET and fix all violations

This commit is contained in:
J. Nick Koston
2025-07-27 08:34:43 -10:00
parent 14862904ac
commit a4026d6ba1
39 changed files with 79 additions and 133 deletions

View File

@@ -18,11 +18,10 @@ def sort_dicts(obj):
"""Recursively sort dictionaries for order-insensitive comparison."""
if isinstance(obj, dict):
return {k: sort_dicts(obj[k]) for k in sorted(obj)}
elif isinstance(obj, list):
if isinstance(obj, list):
# Lists are not sorted; we preserve order
return [sort_dicts(i) for i in obj]
else:
return obj
return obj
def dict_diff(a, b, path=""):

View File

@@ -22,8 +22,7 @@ def _run_repl_test(input_data):
call[0][0] for call in mock_stdout.write.call_args_list
).strip()
splitted_output = full_output.split("\n")
remove_version = splitted_output[1:] # remove first entry with version info
return remove_version
return splitted_output[1:] # remove first entry with version info
def _validate(file_path: str):