Skip to content

Commit

Permalink
update code-checkers config (#9707)
Browse files Browse the repository at this point in the history
fix `all-checks` command

Signed-off-by: Sergei Solonitcyn <sergei.solonitcyn@zazmic.com>
  • Loading branch information
sergei-solonitcyn authored Feb 10, 2022
1 parent b22efc0 commit e3e05d7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
22 changes: 15 additions & 7 deletions airbyte-integrations/connectors/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"lxml": "4.7",
}


TASK_COMMANDS: Dict[str, List[str]] = {
"black": [
f"pip install black~={TOOLS_VERSIONS['black']}",
Expand All @@ -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": [
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)"})
Expand Down
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit e3e05d7

Please sign in to comment.