Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable all TID ruff rules #126312

Merged
merged 3 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion homeassistant/components/trace/websocket_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
debug_stop,
)

from .. import trace
from .. import trace # noqa: TID252 (see PR 125822)

TRACE_DOMAINS = ("automation", "script")

Expand Down
3 changes: 2 additions & 1 deletion homeassistant/helpers/config_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1119,7 +1119,8 @@ def custom_serializer(schema: Any) -> Any:

def _custom_serializer(schema: Any, *, allow_section: bool) -> Any:
"""Serialize additional types for voluptuous_serialize."""
from .. import data_entry_flow # pylint: disable=import-outside-toplevel
from homeassistant import data_entry_flow # pylint: disable=import-outside-toplevel

from . import selector # pylint: disable=import-outside-toplevel

if schema is positive_time_period_dict:
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/helpers/discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
from homeassistant import core, setup
from homeassistant.const import Platform
from homeassistant.loader import bind_hass
from homeassistant.util.signal_type import SignalTypeFormat

from ..util.signal_type import SignalTypeFormat
from .dispatcher import async_dispatcher_connect, async_dispatcher_send_internal
from .typing import ConfigType, DiscoveryInfoType

Expand Down
7 changes: 6 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ select = [
"T100", # Trace found: {name} used
"T20", # flake8-print
"TCH", # flake8-type-checking
"TID251", # Banned imports
"TID", # Tidy imports
"TRY", # tryceratops
"UP", # pyupgrade
"UP031", # Use format specifiers instead of percent format
Expand Down Expand Up @@ -911,6 +911,11 @@ split-on-trailing-comma = false
"homeassistant/scripts/*" = ["T201"]
"script/*" = ["T20"]

# Allow relative imports within auth and within components
"homeassistant/auth/*/*" = ["TID252"]
"homeassistant/components/*/*/*" = ["TID252"]
"tests/components/*/*/*" = ["TID252"]

# Temporary
"homeassistant/**" = ["PTH"]
"tests/**" = ["PTH"]
Expand Down
2 changes: 1 addition & 1 deletion tests/helpers/test_debounce.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from homeassistant.helpers import debounce
from homeassistant.util.dt import utcnow

from ..common import async_fire_time_changed
from tests.common import async_fire_time_changed

_LOGGER = logging.getLogger(__name__)

Expand Down