mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
@@ -1,6 +0,0 @@
|
||||
flake8_plugin_utils
|
||||
flake8_plugin_utils.plugin
|
||||
flake8_plugin_utils.utils
|
||||
flake8_plugin_utils.utils.assertions
|
||||
flake8_plugin_utils.utils.constants
|
||||
flake8_plugin_utils.utils.equiv_nodes
|
||||
@@ -1,7 +0,0 @@
|
||||
version = "1.3.*"
|
||||
upstream_repository = "https://github.com/afonasev/flake8-plugin-utils"
|
||||
partial_stub = true
|
||||
obsolete_since = "1.3.3" # Released on 2023-06-26
|
||||
|
||||
[tool.stubtest]
|
||||
ignore_missing_stub = true
|
||||
@@ -1,9 +0,0 @@
|
||||
from .plugin import Error as Error, Plugin as Plugin, Visitor as Visitor
|
||||
from .utils import (
|
||||
assert_error as assert_error,
|
||||
assert_not_error as assert_not_error,
|
||||
check_equivalent_nodes as check_equivalent_nodes,
|
||||
is_false as is_false,
|
||||
is_none as is_none,
|
||||
is_true as is_true,
|
||||
)
|
||||
@@ -1,41 +0,0 @@
|
||||
import argparse
|
||||
import ast
|
||||
from collections.abc import Iterable, Iterator
|
||||
from typing import Any, Generic, TypeVar, overload
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
FLAKE8_ERROR: TypeAlias = tuple[int, int, str, type[Any]]
|
||||
TConfig = TypeVar("TConfig") # noqa: Y001 # Name of the TypeVar matches the name at runtime
|
||||
|
||||
class Error:
|
||||
code: str
|
||||
message: str
|
||||
lineno: int
|
||||
col_offset: int
|
||||
def __init__(self, lineno: int, col_offset: int, **kwargs: Any) -> None: ...
|
||||
@classmethod
|
||||
def formatted_message(cls, **kwargs: Any) -> str: ...
|
||||
|
||||
class Visitor(ast.NodeVisitor, Generic[TConfig]):
|
||||
errors: list[Error]
|
||||
@overload
|
||||
def __init__(self, config: None = None) -> None: ...
|
||||
@overload
|
||||
def __init__(self, config: TConfig) -> None: ...
|
||||
@property
|
||||
def config(self) -> TConfig: ...
|
||||
def error_from_node(self, error: type[Error], node: ast.AST, **kwargs: Any) -> None: ...
|
||||
|
||||
class Plugin(Generic[TConfig]):
|
||||
name: str
|
||||
version: str
|
||||
visitors: list[type[Visitor[TConfig]]]
|
||||
config: TConfig
|
||||
def __init__(self, tree: ast.AST) -> None: ...
|
||||
def run(self) -> Iterable[FLAKE8_ERROR]: ...
|
||||
@classmethod
|
||||
def parse_options(cls, option_manager: Any, options: argparse.Namespace, args: list[str]) -> None: ...
|
||||
@classmethod
|
||||
def parse_options_to_config(cls, option_manager: Any, options: argparse.Namespace, args: list[str]) -> TConfig | None: ...
|
||||
@classmethod
|
||||
def test_config(cls, config: TConfig) -> Iterator[None]: ...
|
||||
@@ -1,3 +0,0 @@
|
||||
from .assertions import assert_error as assert_error, assert_not_error as assert_not_error
|
||||
from .constants import is_false as is_false, is_none as is_none, is_true as is_true
|
||||
from .equiv_nodes import check_equivalent_nodes as check_equivalent_nodes
|
||||
@@ -1,8 +0,0 @@
|
||||
from typing import Any
|
||||
|
||||
from ..plugin import Error as Error, TConfig as TConfig, Visitor as Visitor
|
||||
|
||||
def assert_error(
|
||||
visitor_cls: type[Visitor[TConfig]], src: str, expected: type[Error], config: TConfig | None = None, **kwargs: Any
|
||||
) -> None: ...
|
||||
def assert_not_error(visitor_cls: type[Visitor[TConfig]], src: str, config: TConfig | None = None) -> None: ...
|
||||
@@ -1,5 +0,0 @@
|
||||
import ast
|
||||
|
||||
def is_none(node: ast.AST) -> bool: ...
|
||||
def is_false(node: ast.AST) -> bool: ...
|
||||
def is_true(node: ast.AST) -> bool: ...
|
||||
@@ -1,3 +0,0 @@
|
||||
import ast
|
||||
|
||||
def check_equivalent_nodes(node1: ast.AST, node2: ast.AST) -> bool: ...
|
||||
Reference in New Issue
Block a user