Skip to content

Commit

Permalink
style: change ruff formatting settings
Browse files Browse the repository at this point in the history
  • Loading branch information
d-biehl committed Jan 4, 2024
1 parent e79804c commit 660d8f9
Show file tree
Hide file tree
Showing 67 changed files with 96 additions and 45 deletions.
1 change: 1 addition & 0 deletions packages/analyze/src/robotcode/analyze/cli.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from typing import Tuple, Union

import click

from robotcode.analyze.config import AnalyzerConfig
from robotcode.plugin import Application, pass_application
from robotcode.robot.config.loader import (
Expand Down
1 change: 1 addition & 0 deletions packages/analyze/src/robotcode/analyze/hooks.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from typing import Any, List, Tuple, Type

import click

from robotcode.plugin import hookimpl

from .cli import analyze
Expand Down
1 change: 1 addition & 0 deletions packages/debugger/src/robotcode/debugger/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from typing import Optional, Sequence, Tuple

import click

from robotcode.core.types import ServerMode
from robotcode.plugin import Application, UnknownError, pass_application
from robotcode.plugin.click_helper.options import (
Expand Down
1 change: 1 addition & 0 deletions packages/debugger/src/robotcode/debugger/debugger.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
from robot.running import EXECUTION_CONTEXTS, Keyword, TestCase, TestSuite
from robot.utils import NormalizedDict
from robot.variables import evaluate_expression

from robotcode.core.event import event
from robotcode.core.utils.logging import LoggingDescriptor
from robotcode.robot.utils import get_robot_version
Expand Down
1 change: 1 addition & 0 deletions packages/debugger/src/robotcode/debugger/hooks.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from typing import List

import click

from robotcode.plugin import hookimpl

from .cli import debug
Expand Down
1 change: 1 addition & 0 deletions packages/debugger/src/robotcode/debugger/launcher/cli.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from typing import Optional, Sequence

import click

from robotcode.core.types import ServerMode
from robotcode.core.utils.cli import show_hidden_arguments
from robotcode.plugin import Application, UnknownError, pass_application
Expand Down
1 change: 1 addition & 0 deletions packages/debugger/src/robotcode/debugger/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
)

import click

from robotcode.core.async_tools import (
run_coroutine_from_thread_async,
run_coroutine_in_thread,
Expand Down
3 changes: 2 additions & 1 deletion packages/jsonrpc2/src/robotcode/jsonrpc2/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@
cast,
)

from typing_extensions import Self

from robotcode.core.types import ServerMode, TcpParams
from robotcode.core.utils.logging import LoggingDescriptor
from typing_extensions import Self

from .protocol import JsonRPCException

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from typing import Final, Optional, Sequence, Union

import click

from robotcode.core.types import ServerMode, TcpParams
from robotcode.plugin import Application, UnknownError, pass_application
from robotcode.plugin.click_helper.options import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from typing import List

import click

from robotcode.plugin import hookimpl

from .cli import language_server
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
)
from robot.utils.escaping import split_from_equals, unescape
from robot.variables.search import contains_variable, search_variable

from robotcode.core.lsp.types import (
CodeDescription,
Diagnostic,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from robot.utils.escaping import split_from_equals, unescape
from robot.variables.finders import NOT_FOUND, NumberFinder
from robot.variables.search import contains_variable, search_variable

from robotcode.core.lsp.types import Position
from robotcode.robot.diagnostics.entities import (
LibraryEntry,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
is_variable,
search_variable,
)

from robotcode.core.event import event
from robotcode.core.lsp.types import (
CodeDescription,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from urllib.parse import parse_qs, urlparse

from robot.parsing.lexer.tokens import Token

from robotcode.core.concurrent import threaded
from robotcode.core.lsp.types import (
CodeAction,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
)
from robot.utils.escaping import split_from_equals
from robot.variables.search import contains_variable

from robotcode.core.lsp.types import (
AnnotatedTextEdit,
ChangeAnnotation,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
VariablesImport,
)
from robot.utils.escaping import split_from_equals

from robotcode.core.lsp.types import (
Command,
CompletionContext,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from typing import TYPE_CHECKING, Any, Optional

from robot.parsing.model.statements import Statement

from robotcode.core.concurrent import threaded
from robotcode.core.lsp.types import Position, Range, TextDocumentIdentifier
from robotcode.core.utils.dataclasses import CamelSnakeMixin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from typing import TYPE_CHECKING, Any, List, Optional

from robot.parsing.lexer.tokens import Token

from robotcode.core.concurrent import threaded
from robotcode.core.lsp.types import (
Diagnostic,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from robot.parsing.model.blocks import Keyword, Section, TestCase
from robot.parsing.model.statements import Statement
from robot.variables import search_variable

from robotcode.core.lsp.types import (
DocumentSymbol,
SymbolInformation,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
)

from robot.parsing.lexer.tokens import Token

from robotcode.core.event import tasking_event
from robotcode.core.lsp.types import MessageType
from robotcode.core.uri import Uri
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from typing import TYPE_CHECKING, Any, List, Optional

from robot.parsing.model.blocks import If, Keyword, TestCase

from robotcode.core.concurrent import check_current_thread_canceled
from robotcode.core.lsp.types import FoldingRange
from robotcode.core.utils.logging import LoggingDescriptor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from robot.parsing.lexer.tokens import Token
from robot.parsing.model.blocks import TestCase, TestCaseSection
from robot.parsing.model.statements import Documentation, Tags

from robotcode.core.concurrent import check_current_thread_canceled
from robotcode.core.lsp.types import (
Hover,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from typing import TYPE_CHECKING, Any, Callable, List, Optional, Type, cast

from robot.parsing.lexer.tokens import Token

from robotcode.core.concurrent import check_current_thread_canceled
from robotcode.core.lsp.types import InlayHint, InlayHintKind, Range
from robotcode.core.utils.logging import LoggingDescriptor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from robot.parsing.lexer.tokens import Token
from robot.parsing.model.statements import Statement

from robotcode.core.lsp.types import (
InlineValue,
InlineValueContext,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from typing import TYPE_CHECKING, Any, Callable, List, Optional, Type, cast

from robot.parsing.model.statements import Statement

from robotcode.core.concurrent import check_current_thread_canceled, threaded
from robotcode.core.event import event
from robotcode.core.lsp.types import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

from robot.parsing.lexer.tokens import Token
from robot.parsing.model.statements import Statement

from robotcode.core.lsp.types import (
AnnotatedTextEdit,
ChangeAnnotation,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from typing import TYPE_CHECKING, Any, List, Optional

from robot.parsing.model.statements import Statement

from robotcode.core.lsp.types import Position, SelectionRange
from robotcode.core.utils.logging import LoggingDescriptor
from robotcode.robot.utils.ast import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
)
from robot.utils.escaping import split_from_equals, unescape
from robot.variables.search import is_variable

from robotcode.core.concurrent import check_current_thread_canceled
from robotcode.core.lsp.types import (
Position,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

from robot.parsing.lexer.tokens import Token
from robot.parsing.model.statements import Statement

from robotcode.core.lsp.types import (
MarkupContent,
MarkupKind,
Expand Down
1 change: 1 addition & 0 deletions packages/plugin/src/robotcode/plugin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import click
import pluggy
import tomli_w

from robotcode.core.utils.dataclasses import as_dict, as_json

__all__ = [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from typing import List, Optional, Sequence, Set, Tuple

import click

from robotcode.core.types import ServerMode
from robotcode.plugin import Application
from robotcode.plugin.click_helper.types import (
Expand Down
3 changes: 2 additions & 1 deletion packages/robot/src/robotcode/robot/config/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@
)

import tomli_w
from typing_extensions import Self

from robotcode.core.utils.dataclasses import (
TypeValidationError,
ValidateMixin,
as_dict,
validate_types,
)
from robotcode.core.utils.safe_eval import safe_eval
from typing_extensions import Self

EXTEND_PREFIX_LEN = len("extend_")

Expand Down
6 changes: 2 additions & 4 deletions packages/robot/src/robotcode/robot/diagnostics/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@
cast,
)

from robot.parsing.lexer.tokens import Token
from robotcode.core.lsp.types import Position, Range
from robotcode.robot.utils.ast import range_from_token

from robot.parsing.lexer.tokens import Token

if TYPE_CHECKING:
from robotcode.robot.diagnostics.library_doc import KeywordDoc, LibraryDoc

Expand Down Expand Up @@ -131,9 +130,8 @@ class InvalidVariableError(Exception):

class VariableMatcher:
def __init__(self, name: str) -> None:
from robotcode.robot.utils.match import normalize

from robot.variables.search import search_variable
from robotcode.robot.utils.match import normalize

self.name = name

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
cast,
)

from robot.parsing.lexer.tokens import Token
from robotcode.core.lsp.types import Position, Range
from robotcode.robot.diagnostics.entities import (
ArgumentDefinition,
Expand All @@ -52,8 +53,6 @@
from robotcode.robot.utils.match import normalize, normalize_namespace
from robotcode.robot.utils.stubs import HasError, HasErrors

from robot.parsing.lexer.tokens import Token

RUN_KEYWORD_NAMES = [
"Run Keyword",
"Run Keyword And Continue On Failure",
Expand Down
3 changes: 1 addition & 2 deletions packages/robot/src/robotcode/robot/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from typing import Optional

from robotcode.core.utils.version import Version, create_version_from_str

import robot.version
from robotcode.core.utils.version import Version, create_version_from_str

_robot_version: Optional[Version] = None

Expand Down
3 changes: 1 addition & 2 deletions packages/robot/src/robotcode/robot/utils/ast.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
import itertools
from typing import Any, Iterator, List, Optional, Sequence, Set, Tuple

from robotcode.core.lsp.types import Position, Range

from robot.errors import VariableError
from robot.parsing.lexer.tokens import Token
from robot.parsing.model.statements import EmptyLine, Statement
from robotcode.core.lsp.types import Position, Range

from . import get_robot_version
from .visitor import Visitor
Expand Down
2 changes: 2 additions & 0 deletions packages/runner/src/robotcode/runner/cli/discover/discover.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
from robot.running.builder.builders import SuiteStructureParser
from robot.utils import NormalizedDict, normalize
from robot.utils.filereader import FileReader

from robotcode.core.lsp.types import (
Diagnostic,
DiagnosticSeverity,
Expand Down Expand Up @@ -826,6 +827,7 @@ def info(app: Application) -> None:
"""

from robot.version import get_version as get_version

from robotcode.core.utils.dataclasses import as_dict

from ...__version__ import __version__
Expand Down
1 change: 1 addition & 0 deletions packages/runner/src/robotcode/runner/cli/libdoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from robot.errors import DataError, Information
from robot.libdoc import USAGE, LibDoc
from robot.version import get_full_version

from robotcode.plugin import Application, pass_application
from robotcode.robot.config.loader import load_robot_config_from_path
from robotcode.robot.config.model import LibDocProfile
Expand Down
1 change: 1 addition & 0 deletions packages/runner/src/robotcode/runner/cli/rebot.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from robot.errors import DataError, Information
from robot.rebot import USAGE, Rebot
from robot.version import get_full_version

from robotcode.plugin import Application, pass_application
from robotcode.robot.config.loader import load_robot_config_from_path
from robotcode.robot.config.model import RebotProfile
Expand Down
1 change: 1 addition & 0 deletions packages/runner/src/robotcode/runner/cli/robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from robot.errors import DataError, Information
from robot.run import USAGE, RobotFramework
from robot.version import get_full_version

from robotcode.plugin import Application, pass_application
from robotcode.plugin.click_helper.aliases import AliasedCommand
from robotcode.plugin.click_helper.types import add_options
Expand Down
1 change: 1 addition & 0 deletions packages/runner/src/robotcode/runner/cli/testdoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from robot.errors import DataError, Information
from robot.testdoc import USAGE, TestDoc
from robot.version import get_full_version

from robotcode.plugin import Application, pass_application
from robotcode.robot.config.loader import load_robot_config_from_path
from robotcode.robot.config.model import TestDocProfile
Expand Down
1 change: 1 addition & 0 deletions packages/runner/src/robotcode/runner/hooks.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from typing import List

import click

from robotcode.plugin import hookimpl

from .cli import discover, libdoc, rebot, robot, testdoc
Expand Down
Loading

0 comments on commit 660d8f9

Please sign in to comment.