2020-06-11 00:54:34 +02:00
|
|
|
from typing import List
|
|
|
|
|
2020-07-14 01:43:53 +02:00
|
|
|
from zulint.linters import run_command
|
|
|
|
from zulint.printer import colors
|
2017-07-06 06:50:41 +02:00
|
|
|
|
2017-06-05 16:49:59 +02:00
|
|
|
|
python: Convert function type annotations to Python 3 style.
Generated by com2ann (slightly patched to avoid also converting
assignment type annotations, which require Python 3.6), followed by
some manual whitespace adjustment, and six fixes for runtime issues:
- def __init__(self, token: Token, parent: Optional[Node]) -> None:
+ def __init__(self, token: Token, parent: "Optional[Node]") -> None:
-def main(options: argparse.Namespace) -> NoReturn:
+def main(options: argparse.Namespace) -> "NoReturn":
-def fetch_request(url: str, callback: Any, **kwargs: Any) -> Generator[Callable[..., Any], Any, None]:
+def fetch_request(url: str, callback: Any, **kwargs: Any) -> "Generator[Callable[..., Any], Any, None]":
-def assert_server_running(server: subprocess.Popen[bytes], log_file: Optional[str]) -> None:
+def assert_server_running(server: "subprocess.Popen[bytes]", log_file: Optional[str]) -> None:
-def server_is_up(server: subprocess.Popen[bytes], log_file: Optional[str]) -> bool:
+def server_is_up(server: "subprocess.Popen[bytes]", log_file: Optional[str]) -> bool:
- method_kwarg_pairs: List[FuncKwargPair],
+ method_kwarg_pairs: "List[FuncKwargPair]",
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2020-04-19 03:48:37 +02:00
|
|
|
def check_pep8(files: List[str]) -> bool:
|
2020-07-14 22:50:06 +02:00
|
|
|
if not files:
|
|
|
|
return False
|
2020-07-14 01:43:53 +02:00
|
|
|
return run_command("pep8", next(colors), ["pycodestyle", "--", *files]) != 0
|