Skip to content

Commit 571cbf3

Browse files
authored
[flake8-simplify] Complete stubs (#14259)
1 parent 213e696 commit 571cbf3

18 files changed

+139
-4
lines changed

stubs/flake8-simplify/METADATA.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,2 @@
11
version = "0.22.*"
22
upstream_repository = "https://github.com/MartinThoma/flake8-simplify"
3-
partial_stub = true
4-
5-
[tool.stubtest]
6-
ignore_missing_stub = true
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,30 @@
11
import ast
2+
import logging
23
from collections.abc import Generator
34
from typing import Any, ClassVar
45

6+
logger: logging.Logger
7+
8+
class Visitor(ast.NodeVisitor):
9+
def __init__(self) -> None: ...
10+
def visit_Assign(self, node: ast.Assign) -> None: ...
11+
def visit_Call(self, node: ast.Call) -> None: ...
12+
def visit_With(self, node: ast.With) -> None: ...
13+
def visit_Expr(self, node: ast.Expr) -> None: ...
14+
def visit_BoolOp(self, node: ast.BoolOp) -> None: ...
15+
def visit_If(self, node: ast.If) -> None: ...
16+
def visit_For(self, node: ast.For) -> None: ...
17+
def visit_Subscript(self, node: ast.Subscript) -> None: ...
18+
def visit_Try(self, node: ast.Try) -> None: ...
19+
def visit_UnaryOp(self, node_v: ast.UnaryOp) -> None: ...
20+
def visit_IfExp(self, node: ast.IfExp) -> None: ...
21+
def visit_Compare(self, node: ast.Compare) -> None: ...
22+
def visit_ClassDef(self, node: ast.ClassDef) -> None: ...
23+
524
class Plugin:
625
name: ClassVar[str]
726
version: ClassVar[str]
827
def __init__(self, tree: ast.AST) -> None: ...
928
def run(self) -> Generator[tuple[int, int, str, type[Any]], None, None]: ...
29+
30+
def add_meta(root: ast.AST, level: int = 0) -> None: ...
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
BOOL_CONST_TYPES: tuple[type, ...]
2+
AST_CONST_TYPES: tuple[type, ...]
3+
STR_TYPES: tuple[type, ...]

stubs/flake8-simplify/flake8_simplify/rules/__init__.pyi

Whitespace-only changes.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import ast
2+
3+
from flake8_simplify.utils import Assign
4+
5+
def get_sim904(node: ast.Assign) -> list[tuple[int, int, str]]: ...
6+
def get_sim909(node: Assign) -> list[tuple[int, int, str]]: ...
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import ast
2+
3+
def get_sim101(node: ast.BoolOp) -> list[tuple[int, int, str]]: ...
4+
def get_sim109(node: ast.BoolOp) -> list[tuple[int, int, str]]: ...
5+
def get_sim220(node: ast.BoolOp) -> list[tuple[int, int, str]]: ...
6+
def get_sim221(node: ast.BoolOp) -> list[tuple[int, int, str]]: ...
7+
def get_sim222(node: ast.BoolOp) -> list[tuple[int, int, str]]: ...
8+
def get_sim223(node: ast.BoolOp) -> list[tuple[int, int, str]]: ...
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import ast
2+
import logging
3+
4+
from flake8_simplify.utils import Call
5+
6+
logger: logging.Logger
7+
8+
def get_sim115(node: Call) -> list[tuple[int, int, str]]: ...
9+
def get_sim901(node: ast.Call) -> list[tuple[int, int, str]]: ...
10+
def get_sim905(node: ast.Call) -> list[tuple[int, int, str]]: ...
11+
def get_sim906(node: ast.Call) -> list[tuple[int, int, str]]: ...
12+
def get_sim910(node: Call) -> list[tuple[int, int, str]]: ...
13+
def get_sim911(node: ast.AST) -> list[tuple[int, int, str]]: ...
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import ast
2+
3+
def get_sim120(node: ast.ClassDef) -> list[tuple[int, int, str]]: ...
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import ast
2+
3+
def get_sim118(node: ast.Compare) -> list[tuple[int, int, str]]: ...
4+
def get_sim300(node: ast.Compare) -> list[tuple[int, int, str]]: ...
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import ast
2+
3+
def get_sim112(node: ast.Expr) -> list[tuple[int, int, str]]: ...

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy