Ruff: Add and fix UP rules

This commit is contained in:
Josh Wu
2026-01-01 03:07:06 +08:00
parent 8e28f4e159
commit 3f643de4c1
102 changed files with 922 additions and 999 deletions

View File

@@ -27,7 +27,7 @@ import sys
import yaml
# -----------------------------------------------------------------------------
with open(sys.argv[1], "r") as yaml_file:
with open(sys.argv[1]) as yaml_file:
root = yaml.safe_load(yaml_file)
companies = {}
for company in root["company_identifiers"]:

View File

@@ -18,7 +18,7 @@ import asyncio
# Imports
# -----------------------------------------------------------------------------
import logging
from typing import Any, Optional
from typing import Any
import click
@@ -47,7 +47,7 @@ def print_device_info(device_info: dict[intel.ValueType, Any]) -> None:
# -----------------------------------------------------------------------------
async def get_driver(host: Host, force: bool) -> Optional[intel.Driver]:
async def get_driver(host: Host, force: bool) -> intel.Driver | None:
# Create a driver
driver = await intel.Driver.for_host(host, force)
if driver is None: