From e3e05d79655bc0b2b4c3fbc0c05b8d90fce6dcd8 Mon Sep 17 00:00:00 2001 From: Sergei Solonitcyn <11441558+sergei-solonitcyn@users.noreply.github.com> Date: Thu, 10 Feb 2022 11:15:30 +0200 Subject: [PATCH] update code-checkers config (#9707) fix `all-checks` command Signed-off-by: Sergei Solonitcyn --- airbyte-integrations/connectors/tasks.py | 22 +++++++++++++++------- pyproject.toml | 7 +++++-- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/airbyte-integrations/connectors/tasks.py b/airbyte-integrations/connectors/tasks.py index a210d283a041..524683a82eae 100644 --- a/airbyte-integrations/connectors/tasks.py +++ b/airbyte-integrations/connectors/tasks.py @@ -29,7 +29,6 @@ "lxml": "4.7", } - TASK_COMMANDS: Dict[str, List[str]] = { "black": [ f"pip install black~={TOOLS_VERSIONS['black']}", @@ -53,6 +52,7 @@ "mypy": [ "pip install .", f"pip install mypy~={TOOLS_VERSIONS['mypy']}", + "mypy --install-types --non-interactive ", f"mypy {{source_path}} --config-file={CONFIG_FILE}", ], "test": [ @@ -133,7 +133,7 @@ def _run_task( try: with ctx.prefix(f"source {activator}"): for command in commands: - result = ctx.run(command, warn=True) + result = ctx.run(command, echo=True, warn=True) if result.return_code: exit_code = 1 break @@ -191,11 +191,19 @@ def all_checks(ctx, connectors=None): # type: ignore[no-untyped-def] Zero exit code indicates about successful passing of all checks. Terminate on the first non-zero exit code. """ - black(ctx, connectors=connectors) - flake(ctx, connectors=connectors) - isort(ctx, connectors=connectors) - mypy(ctx, connectors=connectors) - coverage(ctx, connectors=connectors) + tasks = ( + black, + flake, + isort, + mypy, + coverage, + ) + for task_ in tasks: + try: + task_(ctx, connectors=connectors) + except Exit as e: + if e.code: + raise @task(help={"connectors": _arg_help_connectors, "write": "Write changes into the files (runs 'black' without '--check' option)"}) diff --git a/pyproject.toml b/pyproject.toml index 773d47806fe7..17c93117e8b5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,15 +28,17 @@ color_output = false skip_gitignore = true [tool.mypy] -platform = "linux" +cache_dir = "/dev/null" exclude = "build" +incremental = false +platform = "linux" # Strictness ignore_missing_imports = true allow_redefinition = true disallow_incomplete_defs = true disallow_untyped_defs = true -no_implicit_reexport = true +implicit_reexport = true no_strict_optional = true strict_equality = true # Output @@ -45,6 +47,7 @@ show_column_numbers = true show_error_codes = true show_error_context = true # Warnings +warn_no_return = false warn_redundant_casts = true warn_return_any = true warn_unreachable = true