mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
Add isort to CI and run on files
This commit is contained in:
parent
f526cfa4d9
commit
3730e2e726
45 changed files with 112 additions and 113 deletions
|
@ -1,12 +1,12 @@
|
|||
from .gtk_list_item_factory import ExtListItemFactory
|
||||
from .adw_breakpoint import (
|
||||
AdwBreakpointCondition,
|
||||
AdwBreakpointSetter,
|
||||
AdwBreakpointSetters,
|
||||
)
|
||||
from .adw_message_dialog import ExtAdwMessageDialog
|
||||
from .attributes import BaseAttribute
|
||||
from .adw_breakpoint import (
|
||||
AdwBreakpointSetters,
|
||||
AdwBreakpointSetter,
|
||||
AdwBreakpointCondition,
|
||||
)
|
||||
from .binding import Binding
|
||||
from .common import *
|
||||
from .contexts import ScopeCtx, ValueTypeCtx
|
||||
from .expression import (
|
||||
CastExpr,
|
||||
|
@ -23,23 +23,24 @@ from .gobject_signal import Signal
|
|||
from .gtk_a11y import ExtAccessibility
|
||||
from .gtk_combo_box_text import ExtComboBoxItems
|
||||
from .gtk_file_filter import (
|
||||
Filters,
|
||||
ext_file_filter_mime_types,
|
||||
ext_file_filter_patterns,
|
||||
ext_file_filter_suffixes,
|
||||
Filters,
|
||||
)
|
||||
from .gtk_layout import ExtLayout
|
||||
from .gtk_menu import menu, Menu, MenuAttribute
|
||||
from .gtk_list_item_factory import ExtListItemFactory
|
||||
from .gtk_menu import Menu, MenuAttribute, menu
|
||||
from .gtk_scale import ExtScaleMarks
|
||||
from .gtk_size_group import ExtSizeGroupWidgets
|
||||
from .gtk_string_list import ExtStringListStrings
|
||||
from .gtk_styles import ExtStyles
|
||||
from .gtkbuilder_child import Child, ChildType, ChildInternal, ChildExtension
|
||||
from .gtkbuilder_child import Child, ChildExtension, ChildInternal, ChildType
|
||||
from .gtkbuilder_template import Template
|
||||
from .imports import GtkDirective, Import
|
||||
from .property_binding import PropertyBinding
|
||||
from .ui import UI
|
||||
from .types import ClassName
|
||||
from .ui import UI
|
||||
from .values import (
|
||||
Flag,
|
||||
Flags,
|
||||
|
@ -54,8 +55,6 @@ from .values import (
|
|||
Value,
|
||||
)
|
||||
|
||||
from .common import *
|
||||
|
||||
OBJECT_CONTENT_HOOKS.children = [
|
||||
Signal,
|
||||
Property,
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
# SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
|
||||
|
||||
from ..decompiler import truthy, decompile_translatable
|
||||
from ..decompiler import decompile_translatable, truthy
|
||||
from .common import *
|
||||
from .contexts import ValueTypeCtx
|
||||
from .gobject_object import ObjectContent, validate_parent_type
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
from dataclasses import dataclass
|
||||
|
||||
from .common import *
|
||||
from .expression import Expression, LookupOp, LiteralExpr
|
||||
from .expression import Expression, LiteralExpr, LookupOp
|
||||
|
||||
|
||||
class Binding(AstNode):
|
||||
|
|
|
@ -18,36 +18,35 @@
|
|||
# SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
|
||||
|
||||
from .. import gir
|
||||
from ..ast_utils import AstNode, validate, docs, context
|
||||
from ..errors import (
|
||||
CompileError,
|
||||
MultipleErrors,
|
||||
UpgradeWarning,
|
||||
CompileWarning,
|
||||
CodeAction,
|
||||
)
|
||||
from ..completions_utils import *
|
||||
from .. import decompiler as decompile
|
||||
from .. import gir
|
||||
from ..ast_utils import AstNode, context, docs, validate
|
||||
from ..completions_utils import *
|
||||
from ..decompiler import (
|
||||
DecompileCtx,
|
||||
decompile_translatable,
|
||||
decompiler,
|
||||
escape_quote,
|
||||
truthy,
|
||||
decompile_translatable,
|
||||
)
|
||||
from ..errors import (
|
||||
CodeAction,
|
||||
CompileError,
|
||||
CompileWarning,
|
||||
MultipleErrors,
|
||||
UpgradeWarning,
|
||||
)
|
||||
from ..gir import (
|
||||
StringType,
|
||||
BoolType,
|
||||
IntType,
|
||||
FloatType,
|
||||
GirType,
|
||||
Enumeration,
|
||||
ExternType,
|
||||
FloatType,
|
||||
GirType,
|
||||
IntType,
|
||||
StringType,
|
||||
)
|
||||
from ..lsp_utils import Completion, CompletionItemKind, SemanticToken, SemanticTokenType
|
||||
from ..parse_tree import *
|
||||
|
||||
|
||||
OBJECT_CONTENT_HOOKS = AnyOf()
|
||||
LITERAL = AnyOf()
|
||||
|
|
|
@ -38,8 +38,8 @@ class ScopeCtx:
|
|||
|
||||
@cached_property
|
||||
def template(self):
|
||||
from .ui import UI
|
||||
from .gtk_list_item_factory import ExtListItemFactory
|
||||
from .ui import UI
|
||||
|
||||
if isinstance(self.node, UI):
|
||||
return self.node.template
|
||||
|
|
|
@ -20,9 +20,8 @@
|
|||
|
||||
from .common import *
|
||||
from .contexts import ScopeCtx, ValueTypeCtx
|
||||
from .types import TypeName
|
||||
from .gtkbuilder_template import Template
|
||||
|
||||
from .types import TypeName
|
||||
|
||||
expr = Sequence()
|
||||
|
||||
|
|
|
@ -25,7 +25,6 @@ from .common import *
|
|||
from .response_id import ExtResponse
|
||||
from .types import ClassName, ConcreteClassName
|
||||
|
||||
|
||||
RESERVED_IDS = {"this", "self", "template", "true", "false", "null", "none"}
|
||||
|
||||
|
||||
|
|
|
@ -18,12 +18,12 @@
|
|||
# SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
|
||||
|
||||
from .gtkbuilder_template import Template
|
||||
from .values import Value, ObjectValue
|
||||
from .binding import Binding
|
||||
from .common import *
|
||||
from .contexts import ValueTypeCtx
|
||||
from .gtkbuilder_template import Template
|
||||
from .property_binding import PropertyBinding
|
||||
from .binding import Binding
|
||||
from .values import ObjectValue, Value
|
||||
|
||||
|
||||
class Property(AstNode):
|
||||
|
|
|
@ -19,9 +19,9 @@
|
|||
|
||||
import typing as T
|
||||
|
||||
from .gtkbuilder_template import Template
|
||||
from .contexts import ScopeCtx
|
||||
from .common import *
|
||||
from .contexts import ScopeCtx
|
||||
from .gtkbuilder_template import Template
|
||||
|
||||
|
||||
class SignalFlag(AstNode):
|
||||
|
|
|
@ -17,12 +17,12 @@
|
|||
#
|
||||
# SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
|
||||
from .gobject_object import ObjectContent, validate_parent_type
|
||||
from ..decompiler import escape_quote
|
||||
from .attributes import BaseAttribute
|
||||
from .values import Value
|
||||
from .common import *
|
||||
from .contexts import ValueTypeCtx
|
||||
from ..decompiler import escape_quote
|
||||
from .gobject_object import ObjectContent, validate_parent_type
|
||||
from .values import Value
|
||||
|
||||
|
||||
def get_property_types(gir):
|
||||
|
|
|
@ -18,9 +18,9 @@
|
|||
# SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
|
||||
|
||||
from .gobject_object import ObjectContent, validate_parent_type
|
||||
from .common import *
|
||||
from .contexts import ValueTypeCtx
|
||||
from .gobject_object import ObjectContent, validate_parent_type
|
||||
from .values import StringValue
|
||||
|
||||
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
# SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
|
||||
|
||||
from .gobject_object import ObjectContent, validate_parent_type
|
||||
from .common import *
|
||||
from .gobject_object import ObjectContent, validate_parent_type
|
||||
|
||||
|
||||
class Filters(AstNode):
|
||||
|
|
|
@ -18,9 +18,9 @@
|
|||
# SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
|
||||
|
||||
from .gobject_object import ObjectContent, validate_parent_type
|
||||
from .common import *
|
||||
from .contexts import ValueTypeCtx
|
||||
from .gobject_object import ObjectContent, validate_parent_type
|
||||
from .values import Value
|
||||
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
from .gobject_object import ObjectContent, validate_parent_type
|
||||
from ..parse_tree import Keyword
|
||||
from ..ast_utils import AstNode, validate
|
||||
from ..parse_tree import Keyword
|
||||
from .common import *
|
||||
from .types import TypeName
|
||||
from .contexts import ScopeCtx
|
||||
from .gobject_object import ObjectContent, validate_parent_type
|
||||
from .types import TypeName
|
||||
|
||||
|
||||
class ExtListItemFactory(AstNode):
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
#
|
||||
# SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
|
||||
from .gobject_object import validate_parent_type, ObjectContent
|
||||
from .common import *
|
||||
from .gobject_object import ObjectContent, validate_parent_type
|
||||
from .values import StringValue
|
||||
|
||||
|
||||
|
|
|
@ -18,9 +18,9 @@
|
|||
# SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
|
||||
|
||||
from .gobject_object import ObjectContent, validate_parent_type
|
||||
from .common import *
|
||||
from .contexts import ScopeCtx
|
||||
from .gobject_object import ObjectContent, validate_parent_type
|
||||
|
||||
|
||||
class Widget(AstNode):
|
||||
|
|
|
@ -18,9 +18,9 @@
|
|||
# SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
|
||||
|
||||
from .common import *
|
||||
from .gobject_object import ObjectContent, validate_parent_type
|
||||
from .values import StringValue
|
||||
from .common import *
|
||||
|
||||
|
||||
class Item(AstNode):
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
# SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
|
||||
|
||||
from .gobject_object import ObjectContent, validate_parent_type
|
||||
from .common import *
|
||||
from .gobject_object import ObjectContent, validate_parent_type
|
||||
|
||||
|
||||
class StyleClass(AstNode):
|
||||
|
|
|
@ -20,9 +20,9 @@
|
|||
|
||||
from functools import cached_property
|
||||
|
||||
from .common import *
|
||||
from .gobject_object import Object
|
||||
from .response_id import ExtResponse
|
||||
from .common import *
|
||||
|
||||
ALLOWED_PARENTS: T.List[T.Tuple[str, str]] = [
|
||||
("Gtk", "Buildable"),
|
||||
|
|
|
@ -21,9 +21,9 @@ import typing as T
|
|||
|
||||
from blueprintcompiler.language.common import GirType
|
||||
|
||||
from .gobject_object import Object, ObjectContent
|
||||
from .common import *
|
||||
from ..gir import TemplateType
|
||||
from .common import *
|
||||
from .gobject_object import Object, ObjectContent
|
||||
from .types import ClassName, TemplateClassName
|
||||
|
||||
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
# SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
|
||||
|
||||
from .common import *
|
||||
from ..gir import Class, ExternType, Interface
|
||||
from .common import *
|
||||
|
||||
|
||||
class TypeName(AstNode):
|
||||
|
|
|
@ -20,12 +20,12 @@
|
|||
from functools import cached_property
|
||||
|
||||
from .. import gir
|
||||
from .imports import GtkDirective, Import
|
||||
from .gtkbuilder_template import Template
|
||||
from .gobject_object import Object
|
||||
from .gtk_menu import menu, Menu
|
||||
from .common import *
|
||||
from .contexts import ScopeCtx
|
||||
from .gobject_object import Object
|
||||
from .gtk_menu import Menu, menu
|
||||
from .gtkbuilder_template import Template
|
||||
from .imports import GtkDirective, Import
|
||||
|
||||
|
||||
class UI(AstNode):
|
||||
|
|
|
@ -20,9 +20,9 @@
|
|||
import typing as T
|
||||
|
||||
from .common import *
|
||||
from .types import TypeName
|
||||
from .gobject_object import Object
|
||||
from .contexts import ScopeCtx, ValueTypeCtx
|
||||
from .gobject_object import Object
|
||||
from .types import TypeName
|
||||
|
||||
|
||||
class Translated(AstNode):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue