From e20f732227e685ac9913df18b5e22e56ce2b32db Mon Sep 17 00:00:00 2001 From: "Simon A. F. Lund" Date: Tue, 29 Oct 2024 15:29:47 +0100 Subject: [PATCH] fmt: adjust to pcf-formating, black/ruff Signed-off-by: Simon A. F. Lund --- auxi/gen_entity_index.py | 1 + docs/source/conf.py | 9 ++++++++- src/yace/idl/base.py | 3 ++- src/yace/idl/directives.py | 1 - src/yace/targets/collector.py | 1 + src/yace/targets/ctypes/ctypes_sugar.py | 1 + src/yace/targets/ctypes/target.py | 1 + src/yace/targets/target.py | 1 + src/yace/tools.py | 1 + src/yace/transformations.py | 1 + tests/test_compiler.py | 1 + tests/test_emitter.py | 1 + 12 files changed, 19 insertions(+), 3 deletions(-) diff --git a/auxi/gen_entity_index.py b/auxi/gen_entity_index.py index eb3ace2..d47dfe3 100755 --- a/auxi/gen_entity_index.py +++ b/auxi/gen_entity_index.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 from jinja2 import BaseLoader, Environment + from yace.model import Model TEMPLATE = """\ diff --git a/docs/source/conf.py b/docs/source/conf.py index a7f3617..a822c05 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -23,7 +23,14 @@ ] autodoc_default_options = { - "exclude-members": "__weakref__, model_construct, model_dump, model_dump_json, model_copy, model_json_schema", + "exclude-members": ( + "__weakref__, " + "model_construct, " + "model_dump, " + "model_dump_json, " + "model_copy, " + "model_json_schema" + ) } gtagjs_ids = [ diff --git a/src/yace/idl/base.py b/src/yace/idl/base.py index 79c7a79..efc780b 100644 --- a/src/yace/idl/base.py +++ b/src/yace/idl/base.py @@ -51,7 +51,8 @@ def from_cursor(cls, cursor): brief_description = lines[0].strip() data["brief"] = brief_description - # Extract full description (everything after the first line, before any tag like @param/@return) + # Extract full description (everything after the first line, + # before any tag like @param/@return description_lines = [] for line in lines[1:]: if line.strip().startswith("@"): diff --git a/src/yace/idl/directives.py b/src/yace/idl/directives.py index 1ede2f5..d2e66da 100644 --- a/src/yace/idl/directives.py +++ b/src/yace/idl/directives.py @@ -2,7 +2,6 @@ For directives, currently just a placeholder for #include """ - from yace.idl.base import Entity diff --git a/src/yace/targets/collector.py b/src/yace/targets/collector.py index bc4b828..f6d789b 100644 --- a/src/yace/targets/collector.py +++ b/src/yace/targets/collector.py @@ -1,6 +1,7 @@ """ Collect compiler-targets from the current workdir """ + import inspect import typing from importlib.machinery import SourceFileLoader diff --git a/src/yace/targets/ctypes/ctypes_sugar.py b/src/yace/targets/ctypes/ctypes_sugar.py index 07c040c..1952323 100644 --- a/src/yace/targets/ctypes/ctypes_sugar.py +++ b/src/yace/targets/ctypes/ctypes_sugar.py @@ -20,6 +20,7 @@ Copyright (c) 2023 Simon A. F. Lund SPDX-License-Identifier: BSD-3-Clause """ + import ctypes import ctypes.util import os diff --git a/src/yace/targets/ctypes/target.py b/src/yace/targets/ctypes/target.py index 61abacd..3a330fd 100644 --- a/src/yace/targets/ctypes/target.py +++ b/src/yace/targets/ctypes/target.py @@ -3,6 +3,7 @@ ignores them, except for the special-case "c_char_p". """ + import copy import logging as log import shutil diff --git a/src/yace/targets/target.py b/src/yace/targets/target.py index 5a76165..f4296a0 100644 --- a/src/yace/targets/target.py +++ b/src/yace/targets/target.py @@ -1,6 +1,7 @@ """ """ + import os from abc import ABC, abstractmethod diff --git a/src/yace/tools.py b/src/yace/tools.py index 41b3b9c..24a66d0 100644 --- a/src/yace/tools.py +++ b/src/yace/tools.py @@ -39,6 +39,7 @@ ... """ + import logging as log import typing from pathlib import Path diff --git a/src/yace/transformations.py b/src/yace/transformations.py index 3638a4e..74cfe2e 100644 --- a/src/yace/transformations.py +++ b/src/yace/transformations.py @@ -13,6 +13,7 @@ Also, at the IDL-level, then coding-conventions such as CamelCase can be shared by multiple targets. """ + from yace.emitters import camelcase from yace.idl.derivedtypes import Struct, Union from yace.model import ModelWalker diff --git a/tests/test_compiler.py b/tests/test_compiler.py index c00a7ea..c29d729 100644 --- a/tests/test_compiler.py +++ b/tests/test_compiler.py @@ -2,6 +2,7 @@ from pathlib import Path import pytest + from yace.compiler import Compiler VALID = [ diff --git a/tests/test_emitter.py b/tests/test_emitter.py index f70442f..4d34748 100644 --- a/tests/test_emitter.py +++ b/tests/test_emitter.py @@ -1,4 +1,5 @@ import pytest + from yace.emitters import camelcase SNAKECASE = ["foo", "foo_bar", "foo_bar_baz"]