Enable Ruff RUF017 (#121693)

This commit is contained in:
Sid 2024-07-10 21:09:47 +02:00 committed by GitHub
parent 1e0c03257c
commit 319fdf42c3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View File

@ -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(

View File

@ -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