Commit 21ee9cbc authored by Tanguy Le Carrour's avatar Tanguy Le Carrour
Browse files

Add common tasks.

parent 53aeae2a
from invoke import task, Collection # type: ignore
import tasks.test
from tasks.helpers import title
@task()
def format(c):
"""Format code"""
title(format.__doc__)
c.run("black splito tasks")
@task()
def security(c):
"""Check code security issues."""
title(security.__doc__)
c.run("safety check")
ns = Collection()
ns.add_task(format)
ns.add_task(security)
ns.add_collection(tasks.test)
from termcolor import cprint
def title(message: str) -> None:
cprint("\n* {}".format(message), "blue")
from invoke import task
from tasks.helpers import title
@task
def lint(c):
"""Run Linter."""
title(lint.__doc__)
c.run("flake8 splito tasks", pty=True)
@task
def types(c):
"""Run type checker."""
title(types.__doc__)
c.run("mypy --strict splito", pty=True)
@task(lint, types)
def static(c):
pass
@task
def unit(c):
"""Run unit tests."""
title(unit.__doc__)
c.run("mamba --format documentation splito/domain", pty=True)
c.run("mamba --format documentation splito/use_cases", pty=True)
@task
def integration(c):
"""Run integration tests."""
title(integration.__doc__)
pass
@task
def functional(c):
"""Run functional tests."""
title(functional.__doc__)
@task(static, unit)
def fast(c):
pass
@task(integration, functional)
def slow(c):
pass
@task(fast, slow, name="all", default=True)
def all(c):
pass
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment