From 53eae77983f67f9742af6e83f72f2b39343fdacf Mon Sep 17 00:00:00 2001 From: kasium <15907922+kasium@users.noreply.github.com> Date: Fri, 10 Dec 2021 19:55:23 +0100 Subject: [PATCH] Add stubs for flake8-2020 (#6555) --- stubs/flake8-2020/METADATA.toml | 1 + stubs/flake8-2020/flake8_2020.pyi | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 stubs/flake8-2020/METADATA.toml create mode 100644 stubs/flake8-2020/flake8_2020.pyi diff --git a/stubs/flake8-2020/METADATA.toml b/stubs/flake8-2020/METADATA.toml new file mode 100644 index 000000000..6cf9fae44 --- /dev/null +++ b/stubs/flake8-2020/METADATA.toml @@ -0,0 +1 @@ +version = "1.6.*" diff --git a/stubs/flake8-2020/flake8_2020.pyi b/stubs/flake8-2020/flake8_2020.pyi new file mode 100644 index 000000000..3577b66a6 --- /dev/null +++ b/stubs/flake8-2020/flake8_2020.pyi @@ -0,0 +1,14 @@ +# flake8-2020 has type annotations, but PEP 561 states: +# This PEP does not support distributing typing information as part of module-only distributions or single-file modules within namespace packages. +# Therefore typeshed is the best place. + +import ast +from typing import Any, ClassVar, Generator, Type + +class Plugin: + name: ClassVar[str] + version: ClassVar[str] + def __init__(self, tree: ast.AST) -> None: ... + def run(self) -> Generator[tuple[int, int, str, Type[Any]], None, None]: ... + +def __getattr__(name: str) -> Any: ... # incomplete (other attributes are normally not accessed)