From a28869c4a354dad49c687eda2e1908adfa1ccedf Mon Sep 17 00:00:00 2001 From: Jakob Olesen Date: Fri, 13 Jan 2023 13:13:57 +0100 Subject: [PATCH] Various changes by zap and restyler, that has nothing to do with my changes --- docs/_extensions/external_content.py | 4 ++-- scripts/build/build/__init__.py | 3 ++- scripts/build/build_examples.py | 4 ++-- scripts/pregenerate/__init__.py | 9 ++------- .../matter_idl/generators/__init__.py | 6 +++--- .../matter_idl/generators/bridge/__init__.py | 10 +++++----- .../generators/cpp/application/__init__.py | 15 ++++++++------- .../matter_idl/generators/java/__init__.py | 15 ++++++++------- .../py_matter_idl/matter_idl/zapxml/__init__.py | 5 ++--- .../matter_idl/zapxml/handlers/__init__.py | 4 ++-- .../py_matter_yamltests/test_spec_definitions.py | 6 +++--- .../CHIP/zap-generated/MTRBaseClusters.mm | 2 +- 12 files changed, 40 insertions(+), 43 deletions(-) diff --git a/docs/_extensions/external_content.py b/docs/_extensions/external_content.py index f8c2f48a2207ba..1b7592bfe49f7f 100644 --- a/docs/_extensions/external_content.py +++ b/docs/_extensions/external_content.py @@ -35,11 +35,11 @@ import filecmp import os -from pathlib import Path import re import shutil import tempfile -from typing import Dict, Any, List, Optional +from pathlib import Path +from typing import Any, Dict, List, Optional from sphinx.application import Sphinx diff --git a/scripts/build/build/__init__.py b/scripts/build/build/__init__.py index c363f6c3266f84..28cfc63cd41706 100644 --- a/scripts/build/build/__init__.py +++ b/scripts/build/build/__init__.py @@ -4,9 +4,10 @@ from enum import Enum, auto from typing import Sequence -from .targets import BUILD_TARGETS from builders.builder import BuilderOptions +from .targets import BUILD_TARGETS + class BuildSteps(Enum): GENERATED = auto() diff --git a/scripts/build/build_examples.py b/scripts/build/build_examples.py index 14439f32289376..bdd2ea897d1d25 100755 --- a/scripts/build/build_examples.py +++ b/scripts/build/build_examples.py @@ -20,11 +20,11 @@ import click import coloredlogs - -import build from builders.builder import BuilderOptions from runner import PrintOnlyRunner, ShellRunner +import build + sys.path.append(os.path.abspath(os.path.dirname(__file__))) diff --git a/scripts/pregenerate/__init__.py b/scripts/pregenerate/__init__.py index eab3205dc9d981..ba894d89584cdb 100644 --- a/scripts/pregenerate/__init__.py +++ b/scripts/pregenerate/__init__.py @@ -15,15 +15,10 @@ import logging import os - from typing import Iterator -from .types import InputIdlFile, IdlFileType - - -from .pregenerators import CodegenJavaPregenerator -from .pregenerators import CodegenBridgePregenerator -from .pregenerators import CodegenCppAppPregenerator +from .pregenerators import CodegenBridgePregenerator, CodegenCppAppPregenerator, CodegenJavaPregenerator +from .types import IdlFileType, InputIdlFile def FindAllIdls(sdk_root: str) -> Iterator[InputIdlFile]: diff --git a/scripts/py_matter_idl/matter_idl/generators/__init__.py b/scripts/py_matter_idl/matter_idl/generators/__init__.py index 779c5ad800ace2..a0f8112af7d50d 100644 --- a/scripts/py_matter_idl/matter_idl/generators/__init__.py +++ b/scripts/py_matter_idl/matter_idl/generators/__init__.py @@ -13,11 +13,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os import logging -import jinja2 - +import os from typing import Dict + +import jinja2 from matter_idl.matter_idl_types import Idl from .filters import RegisterCommonFilters diff --git a/scripts/py_matter_idl/matter_idl/generators/bridge/__init__.py b/scripts/py_matter_idl/matter_idl/generators/bridge/__init__.py index 149e6cf33e1d04..a785ea7e3dbc97 100644 --- a/scripts/py_matter_idl/matter_idl/generators/bridge/__init__.py +++ b/scripts/py_matter_idl/matter_idl/generators/bridge/__init__.py @@ -16,13 +16,13 @@ import enum import logging import re +from typing import List, Set, Union -from matter_idl.generators import CodeGenerator, GeneratorStorage -from matter_idl.matter_idl_types import Idl, Field, Attribute, Cluster, ClusterSide from matter_idl import matter_idl_types -from matter_idl.generators.types import (ParseDataType, BasicString, BasicInteger, FundamentalType, - IdlType, IdlEnumType, IdlBitmapType, TypeLookupContext) -from typing import Union, List, Set +from matter_idl.generators import CodeGenerator, GeneratorStorage +from matter_idl.generators.types import (BasicInteger, BasicString, FundamentalType, IdlBitmapType, IdlEnumType, IdlType, + ParseDataType, TypeLookupContext) +from matter_idl.matter_idl_types import Attribute, Cluster, ClusterSide, Field, Idl def camel_to_const(s): diff --git a/scripts/py_matter_idl/matter_idl/generators/cpp/application/__init__.py b/scripts/py_matter_idl/matter_idl/generators/cpp/application/__init__.py index ead462b2c33cb0..d756cfce32cbc6 100644 --- a/scripts/py_matter_idl/matter_idl/generators/cpp/application/__init__.py +++ b/scripts/py_matter_idl/matter_idl/generators/cpp/application/__init__.py @@ -12,15 +12,16 @@ # See the License for the specific language governing permissions and # limitations under the License. -from matter_idl.generators import CodeGenerator, GeneratorStorage -from matter_idl.matter_idl_types import Idl, ClusterSide, Field, Attribute, Cluster, FieldQuality, Command, DataType -from matter_idl import matter_idl_types -from matter_idl.generators.types import ParseDataType, BasicString, BasicInteger, FundamentalType, IdlType, IdlEnumType, IdlBitmapType, TypeLookupContext -from typing import Union, List, Set -from stringcase import capitalcase - import enum import logging +from typing import List, Set, Union + +from matter_idl import matter_idl_types +from matter_idl.generators import CodeGenerator, GeneratorStorage +from matter_idl.generators.types import (BasicInteger, BasicString, FundamentalType, IdlBitmapType, IdlEnumType, IdlType, + ParseDataType, TypeLookupContext) +from matter_idl.matter_idl_types import Attribute, Cluster, ClusterSide, Command, DataType, Field, FieldQuality, Idl +from stringcase import capitalcase def serverClustersOnly(clusters: List[Cluster]) -> List[Cluster]: diff --git a/scripts/py_matter_idl/matter_idl/generators/java/__init__.py b/scripts/py_matter_idl/matter_idl/generators/java/__init__.py index a0f465b4e2f416..9fe4daa83506c2 100644 --- a/scripts/py_matter_idl/matter_idl/generators/java/__init__.py +++ b/scripts/py_matter_idl/matter_idl/generators/java/__init__.py @@ -13,15 +13,16 @@ # See the License for the specific language governing permissions and # limitations under the License. -from matter_idl.generators import CodeGenerator, GeneratorStorage -from matter_idl.matter_idl_types import Idl, ClusterSide, Field, Attribute, Cluster, FieldQuality, Command, DataType -from matter_idl import matter_idl_types -from matter_idl.generators.types import ParseDataType, BasicString, BasicInteger, FundamentalType, IdlType, IdlEnumType, IdlBitmapType, TypeLookupContext -from typing import Union, List, Set -from stringcase import capitalcase - import enum import logging +from typing import List, Set, Union + +from matter_idl import matter_idl_types +from matter_idl.generators import CodeGenerator, GeneratorStorage +from matter_idl.generators.types import (BasicInteger, BasicString, FundamentalType, IdlBitmapType, IdlEnumType, IdlType, + ParseDataType, TypeLookupContext) +from matter_idl.matter_idl_types import Attribute, Cluster, ClusterSide, Command, DataType, Field, FieldQuality, Idl +from stringcase import capitalcase def FieldToGlobalName(field: Field, context: TypeLookupContext) -> Union[str, None]: diff --git a/scripts/py_matter_idl/matter_idl/zapxml/__init__.py b/scripts/py_matter_idl/matter_idl/zapxml/__init__.py index 41b31b452ae066..c599cf2ccbd91f 100644 --- a/scripts/py_matter_idl/matter_idl/zapxml/__init__.py +++ b/scripts/py_matter_idl/matter_idl/zapxml/__init__.py @@ -15,12 +15,11 @@ import logging import typing import xml.sax.handler - from dataclasses import dataclass -from typing import Optional, Union, List +from typing import List, Optional, Union -from matter_idl.zapxml.handlers import Context, ZapXmlHandler from matter_idl.matter_idl_types import Idl +from matter_idl.zapxml.handlers import Context, ZapXmlHandler class ParseHandler(xml.sax.handler.ContentHandler): diff --git a/scripts/py_matter_idl/matter_idl/zapxml/handlers/__init__.py b/scripts/py_matter_idl/matter_idl/zapxml/handlers/__init__.py index 3745954a195cfd..b8ac1b1b9f642e 100644 --- a/scripts/py_matter_idl/matter_idl/zapxml/handlers/__init__.py +++ b/scripts/py_matter_idl/matter_idl/zapxml/handlers/__init__.py @@ -12,12 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. +from matter_idl.matter_idl_types import Idl + from .base import BaseHandler from .context import Context from .handlers import ConfiguratorHandler -from matter_idl.matter_idl_types import Idl - class ZapXmlHandler(BaseHandler): """Handles the top level (/) of a zap xml file. diff --git a/scripts/py_matter_yamltests/test_spec_definitions.py b/scripts/py_matter_yamltests/test_spec_definitions.py index 35a2dcd29f911a..ad1fa4639a3c51 100644 --- a/scripts/py_matter_yamltests/test_spec_definitions.py +++ b/scripts/py_matter_yamltests/test_spec_definitions.py @@ -14,10 +14,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -from matter_yamltests.definitions import * - -import unittest import io +import unittest + +from matter_yamltests.definitions import * source_cluster = ''' diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index f1d4d2ed51c5ca..3471a0af98d133 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -33,8 +33,8 @@ using chip::Callback::Callback; using chip::Callback::Cancelable; using namespace chip::app::Clusters; -using chip::SessionHandle; using chip::Messaging::ExchangeManager; +using chip::SessionHandle; // NOLINTBEGIN(clang-analyzer-cplusplus.NewDeleteLeaks): Linter is unable to locate the delete on these objects. @implementation MTRBaseClusterIdentify