1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-04 04:12:23 +01: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

@@ -251,19 +251,18 @@ async def compile_esphome(
if proc.returncode == 0:
# Success!
break
elif proc.returncode == -11 and attempt < max_retries - 1:
if proc.returncode == -11 and attempt < max_retries - 1:
# Segfault (-11 = SIGSEGV), retry
print(
f"Compilation segfaulted (attempt {attempt + 1}/{max_retries}), retrying..."
)
await asyncio.sleep(1) # Brief pause before retry
continue
else:
# Other error or final retry
raise RuntimeError(
f"Failed to compile {config_path}, return code: {proc.returncode}. "
f"Run with 'pytest -s' to see compilation output."
)
# Other error or final retry
raise RuntimeError(
f"Failed to compile {config_path}, return code: {proc.returncode}. "
f"Run with 'pytest -s' to see compilation output."
)
# Load the config to get idedata (blocking call, must use executor)
loop = asyncio.get_running_loop()