Skip to content

Commit

Permalink
Enforce alphabetical sorting in ruff isort (#569)
Browse files Browse the repository at this point in the history
Co-authored-by: Martin Hjelmare <[email protected]>
  • Loading branch information
marcelveldt and MartinHjelmare committed Feb 21, 2024
1 parent 1c0e7e1 commit bc0840e
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion matter_server/common/helpers/json.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
from base64 import b64encode
from typing import Any

import orjson
from chip.clusters.Types import Nullable
from chip.tlv import float32, uint
import orjson

JSON_ENCODE_EXCEPTIONS = (TypeError, ValueError)
JSON_DECODE_EXCEPTIONS = (orjson.JSONDecodeError,)
Expand Down
2 changes: 1 addition & 1 deletion matter_server/server/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import os
from pathlib import Path

import coloredlogs
from aiorun import run
import coloredlogs

from matter_server.server import stack

Expand Down
5 changes: 2 additions & 3 deletions matter_server/server/device_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@
from __future__ import annotations

import asyncio
import logging
from collections import deque
from datetime import datetime
from functools import partial
import logging
from typing import TYPE_CHECKING, Any, Awaitable, Callable, Iterable, TypeVar, cast

from chip.ChipDeviceCtrl import DeviceProxyWrapper
from chip.clusters import Attribute
from chip.clusters import Objects as Clusters
from chip.clusters import Attribute, Objects as Clusters
from chip.clusters.Attribute import ValueDecodeFailure
from chip.clusters.ClusterObjects import ALL_ATTRIBUTES, ALL_CLUSTERS, Cluster
from chip.exceptions import ChipStackError
Expand Down
2 changes: 1 addition & 1 deletion matter_server/server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import asyncio
import ipaddress
import logging
import weakref
from typing import Any, Callable, Set, cast
import weakref

from aiohttp import web

Expand Down
4 changes: 2 additions & 2 deletions matter_server/server/stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
import os
from typing import TYPE_CHECKING

import chip.logging
import chip.native
from chip.ChipStack import ChipStack
import chip.logging
from chip.logging import (
ERROR_CATEGORY_DETAIL,
ERROR_CATEGORY_ERROR,
Expand All @@ -15,6 +14,7 @@
)
from chip.logging.library_handle import _GetLoggingLibraryHandle
from chip.logging.types import LogRedirectCallback_t
import chip.native

if TYPE_CHECKING:
from chip.CertificateAuthority import CertificateAuthorityManager
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ ignore = [
"TD004", # Just annoying, not really useful
"COM812", # Conflict with the Ruff formatter
"ISC001", # Conflict with the Ruff formatter
"I001", # TEMPORARY DISABLED
"TCH003", # TEMPORARY DISABLED
"UP035", # TEMPORARY DISABLED
"TCH002", # TEMPORARY DISABLED
Expand Down Expand Up @@ -252,6 +251,8 @@ fixture-parentheses = false
mark-parentheses = false

[tool.ruff.lint.isort]
combine-as-imports = true
force-sort-within-sections = true
known-first-party = ["matter_server"]

[tool.ruff.lint.mccabe]
Expand Down
2 changes: 1 addition & 1 deletion tests/common/test_parser.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Test parser functions that converts the incoming json from API into dataclass models."""

import datetime
from dataclasses import dataclass
import datetime
from enum import Enum, IntEnum
from typing import Optional

Expand Down

0 comments on commit bc0840e

Please sign in to comment.