From 319fdf42c32d3182d55aa5de684653065628fba8 Mon Sep 17 00:00:00 2001
From: Sid <27780930+autinerd@users.noreply.github.com>
Date: Wed, 10 Jul 2024 21:09:47 +0200
Subject: [PATCH] Enable Ruff RUF017 (#121693)

---
 homeassistant/components/google_cloud/helpers.py | 4 +++-
 pyproject.toml                                   | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/homeassistant/components/google_cloud/helpers.py b/homeassistant/components/google_cloud/helpers.py
index 97fa66b1f18..66dfbcf01eb 100644
--- a/homeassistant/components/google_cloud/helpers.py
+++ b/homeassistant/components/google_cloud/helpers.py
@@ -2,6 +2,8 @@
 
 from __future__ import annotations
 
+import functools
+import operator
 from types import MappingProxyType
 from typing import Any
 
@@ -74,7 +76,7 @@ def tts_options_schema(
             ): SelectSelector(
                 SelectSelectorConfig(
                     mode=SelectSelectorMode.DROPDOWN,
-                    options=["", *sum(voices.values(), [])],
+                    options=["", *functools.reduce(operator.iadd, voices.values(), [])],
                 )
             ),
             vol.Optional(
diff --git a/pyproject.toml b/pyproject.toml
index 5b41ca17a57..7c79cf7b5a5 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -746,6 +746,7 @@ select = [
     "RUF006", # Store a reference to the return value of asyncio.create_task
     "RUF010", # Use explicit conversion flag
     "RUF013", # PEP 484 prohibits implicit Optional
+    "RUF017", # Avoid quadratic list summation
     "RUF018", # Avoid assignment expressions in assert statements
     "RUF019", # Unnecessary key check before dictionary access
     # "RUF100", # Unused `noqa` directive; temporarily every now and then to clean them up
-- 
GitLab