Enable the yield-in-for-loop ruff rule and fix warnings (#2984)

This commit is contained in:
correctmost 2024-12-01 01:50:11 -05:00 committed by GitHub
parent af043afa88
commit 8fa5ec15af
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 2 additions and 5 deletions

View File

@ -80,8 +80,7 @@ class Boot:
def __iter__(self) -> Iterator[bytes]:
if self.session:
for value in self.session:
yield value
yield from self.session
def __contains__(self, key: bytes) -> bool:
if self.session is None:

View File

@ -383,8 +383,7 @@ class SysCommand:
def __iter__(self, *args: list[Any], **kwargs: dict[str, Any]) -> Iterator[bytes]:
if self.session:
for line in self.session:
yield line
yield from self.session
def __getitem__(self, key: slice) -> bytes | None:
if not self.session:

View File

@ -211,7 +211,6 @@ ignore = [
"RUF012", # mutable-class-default
"RUF015", # unnecessary-iterable-allocation-for-first-element
"RUF039", # unraw-re-pattern
"UP028", # yield-in-for-loop
"UP037", # quoted-annotation
"W191", # tab-indentation
]