From 461ef19a46f8a217db97800127ac4fe2bf3e9c96 Mon Sep 17 00:00:00 2001 From: gregorni Date: Sun, 3 Sep 2023 18:44:58 +0200 Subject: [PATCH] Run black --- blueprintcompiler/language/__init__.py | 43 ++++++++++++++++++++------ blueprintcompiler/language/common.py | 42 +++++++++++++++++++------ blueprintcompiler/parse_tree.py | 9 ++++-- tests/fuzz.py | 8 +++-- tests/test_samples.py | 8 +++-- 5 files changed, 85 insertions(+), 25 deletions(-) diff --git a/blueprintcompiler/language/__init__.py b/blueprintcompiler/language/__init__.py index 23262c9..39d8336 100644 --- a/blueprintcompiler/language/__init__.py +++ b/blueprintcompiler/language/__init__.py @@ -1,20 +1,33 @@ -from .adw_breakpoint import (AdwBreakpointCondition, AdwBreakpointSetter, - AdwBreakpointSetters) +from .adw_breakpoint import ( + AdwBreakpointCondition, + AdwBreakpointSetter, + AdwBreakpointSetters, +) from .adw_message_dialog import ExtAdwMessageDialog from .attributes import BaseAttribute from .binding import Binding from .common import * from .contexts import ScopeCtx, ValueTypeCtx -from .expression import (CastExpr, ClosureArg, ClosureExpr, ExprBase, - Expression, LiteralExpr, LookupOp) +from .expression import ( + CastExpr, + ClosureArg, + ClosureExpr, + ExprBase, + Expression, + LiteralExpr, + LookupOp, +) from .gobject_object import Object, ObjectContent from .gobject_property import Property 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) +from .gtk_file_filter import ( + Filters, + ext_file_filter_mime_types, + ext_file_filter_patterns, + ext_file_filter_suffixes, +) from .gtk_layout import ExtLayout from .gtk_list_item_factory import ExtListItemFactory from .gtk_menu import Menu, MenuAttribute, menu @@ -27,9 +40,19 @@ from .gtkbuilder_template import Template from .imports import GtkDirective, Import from .types import ClassName from .ui import UI -from .values import (Flag, Flags, IdentLiteral, Literal, NumberLiteral, - ObjectValue, QuotedLiteral, StringValue, Translated, - TypeLiteral, Value) +from .values import ( + Flag, + Flags, + IdentLiteral, + Literal, + NumberLiteral, + ObjectValue, + QuotedLiteral, + StringValue, + Translated, + TypeLiteral, + Value, +) OBJECT_CONTENT_HOOKS.children = [ Signal, diff --git a/blueprintcompiler/language/common.py b/blueprintcompiler/language/common.py index 66d88d3..8a6ce9b 100644 --- a/blueprintcompiler/language/common.py +++ b/blueprintcompiler/language/common.py @@ -22,15 +22,39 @@ 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) -from ..errors import (CodeAction, CompileError, CompileWarning, - DeprecatedWarning, MultipleErrors, UpgradeWarning) -from ..gir import (BoolType, Enumeration, ExternType, FloatType, GirType, - IntType, StringType) -from ..lsp_utils import (Completion, CompletionItemKind, DocumentSymbol, - LocationLink, SemanticToken, SemanticTokenType, - SymbolKind) +from ..decompiler import ( + DecompileCtx, + decompile_translatable, + decompiler, + escape_quote, + truthy, +) +from ..errors import ( + CodeAction, + CompileError, + CompileWarning, + DeprecatedWarning, + MultipleErrors, + UpgradeWarning, +) +from ..gir import ( + BoolType, + Enumeration, + ExternType, + FloatType, + GirType, + IntType, + StringType, +) +from ..lsp_utils import ( + Completion, + CompletionItemKind, + DocumentSymbol, + LocationLink, + SemanticToken, + SemanticTokenType, + SymbolKind, +) from ..parse_tree import * OBJECT_CONTENT_HOOKS = AnyOf() diff --git a/blueprintcompiler/parse_tree.py b/blueprintcompiler/parse_tree.py index 66b14f7..8f3ef31 100644 --- a/blueprintcompiler/parse_tree.py +++ b/blueprintcompiler/parse_tree.py @@ -23,8 +23,13 @@ import typing as T from enum import Enum from .ast_utils import AstNode -from .errors import (CompileError, CompilerBugError, CompileWarning, - UnexpectedTokenError, assert_true) +from .errors import ( + CompileError, + CompilerBugError, + CompileWarning, + UnexpectedTokenError, + assert_true, +) from .tokenizer import Range, Token, TokenType SKIP_TOKENS = [TokenType.COMMENT, TokenType.WHITESPACE] diff --git a/tests/fuzz.py b/tests/fuzz.py index 83d5270..81a9058 100644 --- a/tests/fuzz.py +++ b/tests/fuzz.py @@ -9,8 +9,12 @@ sys.path.insert(0, os.path.dirname(os.path.dirname(__file__))) from blueprintcompiler import decompiler, gir, parser, tokenizer, utils from blueprintcompiler.completions import complete -from blueprintcompiler.errors import (CompileError, CompilerBugError, - MultipleErrors, PrintableError) +from blueprintcompiler.errors import ( + CompileError, + CompilerBugError, + MultipleErrors, + PrintableError, +) from blueprintcompiler.tokenizer import Token, TokenType, tokenize diff --git a/tests/test_samples.py b/tests/test_samples.py index 96e3b6e..226e762 100644 --- a/tests/test_samples.py +++ b/tests/test_samples.py @@ -29,8 +29,12 @@ from gi.repository import Gtk from blueprintcompiler import decompiler, parser, tokenizer, utils from blueprintcompiler.completions import complete -from blueprintcompiler.errors import (CompileError, DeprecatedWarning, - MultipleErrors, PrintableError) +from blueprintcompiler.errors import ( + CompileError, + DeprecatedWarning, + MultipleErrors, + PrintableError, +) from blueprintcompiler.lsp import LanguageServer from blueprintcompiler.outputs.xml import XmlOutput from blueprintcompiler.tokenizer import Token, TokenType, tokenize