Skip to content

Commit bc0840e

Browse files
Enforce alphabetical sorting in ruff isort (#569)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
1 parent 1c0e7e1 commit bc0840e

File tree

7 files changed

+10
-10
lines changed

7 files changed

+10
-10
lines changed

matter_server/common/helpers/json.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
from base64 import b64encode
44
from typing import Any
55

6-
import orjson
76
from chip.clusters.Types import Nullable
87
from chip.tlv import float32, uint
8+
import orjson
99

1010
JSON_ENCODE_EXCEPTIONS = (TypeError, ValueError)
1111
JSON_DECODE_EXCEPTIONS = (orjson.JSONDecodeError,)

matter_server/server/__main__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
import os
66
from pathlib import Path
77

8-
import coloredlogs
98
from aiorun import run
9+
import coloredlogs
1010

1111
from matter_server.server import stack
1212

matter_server/server/device_controller.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@
55
from __future__ import annotations
66

77
import asyncio
8-
import logging
98
from collections import deque
109
from datetime import datetime
1110
from functools import partial
11+
import logging
1212
from typing import TYPE_CHECKING, Any, Awaitable, Callable, Iterable, TypeVar, cast
1313

1414
from chip.ChipDeviceCtrl import DeviceProxyWrapper
15-
from chip.clusters import Attribute
16-
from chip.clusters import Objects as Clusters
15+
from chip.clusters import Attribute, Objects as Clusters
1716
from chip.clusters.Attribute import ValueDecodeFailure
1817
from chip.clusters.ClusterObjects import ALL_ATTRIBUTES, ALL_CLUSTERS, Cluster
1918
from chip.exceptions import ChipStackError

matter_server/server/server.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
import asyncio
66
import ipaddress
77
import logging
8-
import weakref
98
from typing import Any, Callable, Set, cast
9+
import weakref
1010

1111
from aiohttp import web
1212

matter_server/server/stack.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@
44
import os
55
from typing import TYPE_CHECKING
66

7-
import chip.logging
8-
import chip.native
97
from chip.ChipStack import ChipStack
8+
import chip.logging
109
from chip.logging import (
1110
ERROR_CATEGORY_DETAIL,
1211
ERROR_CATEGORY_ERROR,
@@ -15,6 +14,7 @@
1514
)
1615
from chip.logging.library_handle import _GetLoggingLibraryHandle
1716
from chip.logging.types import LogRedirectCallback_t
17+
import chip.native
1818

1919
if TYPE_CHECKING:
2020
from chip.CertificateAuthority import CertificateAuthorityManager

pyproject.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ ignore = [
168168
"TD004", # Just annoying, not really useful
169169
"COM812", # Conflict with the Ruff formatter
170170
"ISC001", # Conflict with the Ruff formatter
171-
"I001", # TEMPORARY DISABLED
172171
"TCH003", # TEMPORARY DISABLED
173172
"UP035", # TEMPORARY DISABLED
174173
"TCH002", # TEMPORARY DISABLED
@@ -252,6 +251,8 @@ fixture-parentheses = false
252251
mark-parentheses = false
253252

254253
[tool.ruff.lint.isort]
254+
combine-as-imports = true
255+
force-sort-within-sections = true
255256
known-first-party = ["matter_server"]
256257

257258
[tool.ruff.lint.mccabe]

tests/common/test_parser.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Test parser functions that converts the incoming json from API into dataclass models."""
22

3-
import datetime
43
from dataclasses import dataclass
4+
import datetime
55
from enum import Enum, IntEnum
66
from typing import Optional
77

0 commit comments

Comments
 (0)